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

Add ability to customize ssl mode settings #474

Closed
thereisnosun opened this issue Jan 13, 2021 · 2 comments · Fixed by #475
Closed

Add ability to customize ssl mode settings #474

thereisnosun opened this issue Jan 13, 2021 · 2 comments · Fixed by #475

Comments

@thereisnosun
Copy link
Contributor

At the moment mysql-client have following defined:

#if ((MYSQL_VERSION_ID >= 50555 && MYSQL_VERSION_ID <= 50599) || \
(MYSQL_VERSION_ID >= 50636 && MYSQL_VERSION_ID <= 50699) || \
(MYSQL_VERSION_ID >= 50711 && MYSQL_VERSION_ID <= 50799) || \
(MYSQL_VERSION_ID >= 80000)) && \
!defined(MARIADB_BASE_VERSION) && !defined(MARIADB_VERSION_ID)
#define HAVE_ENUM_MYSQL_OPT_SSL_MODE
#endif

meaning, that it will accept ssl_mode argument only in the case of MySQL, but not in the case of MariaDB. This is pretty odd, because even though MariaDB does not support the sophisticated ssl_mode argument as MySQL does, it still allows some SSL tweaking:

  • MYSQL_OPT_SSL_VERIFY_SERVER_CERT: Enables (or disables) server certificate verification

  • MYSQL_OPT_SSL_ENFORCE: Whether to force TLS. This enables TLS with the default system settings. It does not prevent the connection from being created if the server does not support TLS.

See more: https://mariadb.com/kb/en/mysql_optionsv/

So, seems logical for me to do is to allow the same ssl_mode option for MariaDB, but inside of mysqlclient handle it accordingly. So for the lib user, the interface would remain the same.

thereisnosun pushed a commit to thereisnosun/mysqlclient that referenced this issue Jan 13, 2021
@thereisnosun
Copy link
Contributor Author

I already provided the PR, which is fixing the issue described above:
#475
Let's discuss the change and make mysqlclient even better :)

thereisnosun pushed a commit to thereisnosun/mysqlclient that referenced this issue Feb 25, 2021
@matusvalo
Copy link

ssl_mode is already present in the code - see https://github.com/PyMySQL/mysqlclient/blob/main/doc/user_guide.rst#functions-and-attributes.

The documentation in https://mysqlclient.readthedocs.io/ is outdated and hence missing this information (#552)

@methane methane linked a pull request May 15, 2023 that will close this issue
ShrushtiNewalkar referenced this issue in ShrushtiNewalkar/Machine-Test Mar 31, 2024
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 a pull request may close this issue.

2 participants