Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ssl=True #700

Merged
merged 2 commits into from Feb 8, 2024
Merged

Support ssl=True #700

merged 2 commits into from Feb 8, 2024

Conversation

methane
Copy link
Member

@methane methane commented Feb 8, 2024

MySQL use ssl by default but MariaDB don't.

Until mysqlclient<=2.2.1, ssl=True unintentionally allowed and it called mysql_ssl_set(mysql, NULL, NULL, NULL, NULL, NULL). Although it is no-op in MySQL Connector, MariaDB Connector silently set MYSQL_OPT_SSL_ENFORCE when the API is called. (See #698)

In case of PyMySQL, ssl is not used by default but ssl=True behave like sslmode="PREFERRED".

For better backward compatibility and compatibility with PyMySQL and security, I decided to allow ssl=True and it means sslmode="REQUIRED" on MySQL Connector and
set MYSQL_OPT_SSL_ENFORCE on MariaDB Connector.

Fix #699

MySQL use ssl by default but MariaDB don't.

Until mysqlclient<=2.2.1, `ssl=True` unintentionally allowed and
it called `mysql_ssl_set(mysql, NULL, NULL, NULL, NULL, NULL)`.
Although it is no-op in MySQL Connector, MariaDB Connector silently
set MYSQL_OPT_SSL_ENFORCE when the API is called. (See PyMySQL#698)

In case of PyMySQL, ssl is not used by default but `ssl=True` behave like
`sslmode="PREFERRED"`.

For better backward compatibility and compatibility with PyMySQL and
security, I decided to allow ssl=True and it means sslmode="REQUIRED".
@methane methane changed the title Support ssl=True Support ssl=True Feb 8, 2024
@methane methane merged commit a7e3887 into PyMySQL:main Feb 8, 2024
9 checks passed
@methane methane deleted the ssl-equal-true branch February 8, 2024 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support ssl=True
1 participant