diff options
author | Federico Caselli <cfederico87@gmail.com> | 2023-01-11 20:33:16 +0100 |
---|---|---|
committer | Federico Caselli <cfederico87@gmail.com> | 2023-01-11 20:33:16 +0100 |
commit | a06cd94baab114cd0b2fa0987267e31811d38f7a (patch) | |
tree | 52a848fe95fc2f91bb4e9c736808c6f8ad1926cf | |
parent | e636917a721f4bb01264a23736c9c81e462863cb (diff) | |
download | sqlalchemy-a06cd94baab114cd0b2fa0987267e31811d38f7a.tar.gz |
Move docs in mysql dbapi
Fixes: #9084
Change-Id: I5e174c318a20b7fcb5ea7c771293c5102e761ed7
-rw-r--r-- | lib/sqlalchemy/dialects/mysql/mysqldb.py | 13 | ||||
-rw-r--r-- | lib/sqlalchemy/dialects/mysql/pymysql.py | 14 |
2 files changed, 13 insertions, 14 deletions
diff --git a/lib/sqlalchemy/dialects/mysql/mysqldb.py b/lib/sqlalchemy/dialects/mysql/mysqldb.py index 8cdfd698f..5c9d11a53 100644 --- a/lib/sqlalchemy/dialects/mysql/mysqldb.py +++ b/lib/sqlalchemy/dialects/mysql/mysqldb.py @@ -65,19 +65,6 @@ where they will be interpreted into the "ssl" dictionary automatically: "&ssl_key=/home/gord/client-ssl/client-key.pem" ) -If the server uses an automatically-generated certificate that is self-signed -or does not match the host name (as seen from the client), it may also be -necessary to indicate ``ssl_check_hostname=false``:: - - connection_uri = ( - "mysql+pymysql://scott:tiger@192.168.0.134/test" - "?ssl_ca=/home/gord/client-ssl/ca.pem" - "&ssl_cert=/home/gord/client-ssl/client-cert.pem" - "&ssl_key=/home/gord/client-ssl/client-key.pem" - "&ssl_check_hostname=false" - ) - - .. seealso:: :ref:`pymysql_ssl` in the PyMySQL dialect diff --git a/lib/sqlalchemy/dialects/mysql/pymysql.py b/lib/sqlalchemy/dialects/mysql/pymysql.py index cdd579544..67ccb17fd 100644 --- a/lib/sqlalchemy/dialects/mysql/pymysql.py +++ b/lib/sqlalchemy/dialects/mysql/pymysql.py @@ -27,7 +27,19 @@ SSL Connections ------------------ The PyMySQL DBAPI accepts the same SSL arguments as that of MySQLdb, -described at :ref:`mysqldb_ssl`. See that section for examples. +described at :ref:`mysqldb_ssl`. See that section for additional examples. + +If the server uses an automatically-generated certificate that is self-signed +or does not match the host name (as seen from the client), it may also be +necessary to indicate ``ssl_check_hostname=false`` in PyMySQL:: + + connection_uri = ( + "mysql+pymysql://scott:tiger@192.168.0.134/test" + "?ssl_ca=/home/gord/client-ssl/ca.pem" + "&ssl_cert=/home/gord/client-ssl/client-cert.pem" + "&ssl_key=/home/gord/client-ssl/client-key.pem" + "&ssl_check_hostname=false" + ) MySQL-Python Compatibility |