Fixes: #5692
ssl_mode flag is added to mysqldb
### Description
mysqldb driver supports "ssl_mode" flag, which can be one of following values:
"DISABLED", "PREFERRED", "REQUIRED", "VERIFY_CA", "VERIFY_IDENTITY".
Depending on these values MySQL will behave accordingly to them.
So this flag has been added to the sqlaclhemy. So in case if TLS is not supported on the server, we can drop the connection right away.
Closes: #5693
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5693
Pull-request-sha:
94aed8b17d21da9a20be4b092f6a60b12f60b761
Change-Id: I7657b9c812d3a40ccacebbd8f4d5f20659d447c3
--- /dev/null
+.. change::
+ :tags: mysql, usecase
+ :tickets: 5692
+
+ Added ``ssl_mode`` dialect keyword to MySQL dialect for use with mysqldb.
+ Pull request courtesy Teodor Moroz.
util.coerce_kw_type(opts, "write_timeout", int)
util.coerce_kw_type(opts, "client_flag", int)
util.coerce_kw_type(opts, "local_infile", int)
+ util.coerce_kw_type(opts, "ssl_mode", str)
# Note: using either of the below will cause all strings to be
# returned as Unicode, both in raw SQL operations and with column
# types like String and MSString.
make_url(
"mysql://scott:tiger@localhost:3306/test"
"?ssl_ca=/ca.pem&ssl_cert=/cert.pem&ssl_key=/key.pem"
+ "&ssl_mode=REQUIRED"
)
)[1]
# args that differ among mysqldb and oursql
"cert": "/cert.pem",
"key": "/key.pem",
},
+ "ssl_mode": "REQUIRED",
"host": "localhost",
"user": "scott",
"port": 3306,