Skip to content

Add ability to customize ssl mode settings #474

Description

@thereisnosun

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.

Activity

  1. added a commit that references this issue on Jan 13, 2021
  2. thereisnosun commented on Jan 13, 2021

    @thereisnosun
    ContributorAuthor

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

  3. added a commit that references this issue on Feb 25, 2021
  4. matusvalo commented on Aug 12, 2022

    @matusvalo

    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)

  5. linked a pull request that will close this issueAdd ability to customize ssl mode settings #475on May 15, 2023
  6. added a commit that references this issue on Mar 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions