Bug #106426 | Support for passing in existing SSL connection to MySQL Python Connector | ||
---|---|---|---|
Submitted: | 9 Feb 2022 19:17 | Modified: | 14 Feb 2022 16:38 |
Reporter: | Jack Wotherspoon (OCA) | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | Connector / Python | Severity: | S4 (Feature request) |
Version: | 8.0 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[9 Feb 2022 19:17]
Jack Wotherspoon
[10 Feb 2022 4:01]
MySQL Verification Team
Hello Jack, Thank you for the feature request! regards, Umesh
[11 Feb 2022 16:13]
Nuno Mariz
Posted by developer: Can you elaborate the goal of providing a `ssl.SSLContext` in the connection options? For the pure Python is possible to pass such object, but for the C extension we need to extract the information from object, with `SSLContext.get_ca_certs()`, `SSLContext.get_ciphers()`, etc. and pass them to libmysqlclient.
[14 Feb 2022 16:38]
Jack Wotherspoon
Yes, for sure! The main goal is to be able to connect with a pre-configured SSL connection. We currently create an SSL Context object and use `SSLContext.load_cert_chain()` to load in the cert and key from temporary files. https://github.com/GoogleCloudPlatform/cloud-sql-python-connector/blob/main/google/cloud/s... We currently have it so that we later use the pre-configured SSL Context when making connections to Cloud SQL via pure python drivers such as pymysql, pg8000 and pytds. Ideally, we would like to follow the same pattern to connect to the MySQL Python Connector if possible. Let me know if this helps add any insight into the issue. Happy to provide more info or clear things up if need be. Thanks!