Skip to content

Support for passing in connection arg or existing SSL connection to aiomysql.connect() #757

Open
@jackwotherspoon

Description

@jackwotherspoon

Is your feature request related to a problem?

Not currently able to support aiomysql with Cloud SQL Python Connector.

Describe the solution you'd like

The Cloud SQL Python Connector would like to support database connections to Cloud SQL using aiomysql. The Cloud SQL connectors connect to a server side proxy that authorizes users based on a TLS client cert. In order to do this in aiomysql, we require the ability to configure the connection level SSL (outside of the database protocol) or pass in an existing connection (with its own SSL/TLS configuration).

Describe alternatives you've considered

For the pg8000 driver, we use the first option – their ssl_context argument allows us to pass in our pre-configured ssl.SSLContext object as long as the custom require_ssl attribute is set to False in order to skip the database level SSL protocol . pg8000 code

For PyMySQL, we create the connection ahead of time, wrap it with our own SSL config, and pass it to the driver.

Additional context

Would either of these options be suitable for aiomysql? Happy to provide more information or assist on this if needed. Thanks so much!

Code of Conduct

  • I agree to follow the aio-libs Code of Conduct

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions