mirror of
https://github.com/PyMySQL/mysqlclient.git
synced 2025-08-15 11:10:58 +08:00
Fix mariadbclient SSL support (#609)
This commit is contained in:

committed by
GitHub

parent
ba85984505
commit
398208f8c8
@ -531,10 +531,11 @@ _mysql_ConnectionObject_Initialize(
|
||||
// See https://github.com/PyMySQL/mysqlclient/issues/474
|
||||
// TODO: Does MariaDB supports PREFERRED and VERIFY_CA?
|
||||
// We support only two levels for now.
|
||||
if (sslmode_num >= SSLMODE_REQUIRED) {
|
||||
my_bool enforce_tls = 1;
|
||||
if (ssl_mode_num >= SSLMODE_REQUIRED) {
|
||||
mysql_optionsv(&(self->connection), MYSQL_OPT_SSL_ENFORCE, (void *)&enforce_tls);
|
||||
}
|
||||
if (sslmode_num >= SSLMODE_VERIFY_CA) {
|
||||
if (ssl_mode_num >= SSLMODE_VERIFY_CA) {
|
||||
mysql_optionsv(&(self->connection), MYSQL_OPT_SSL_VERIFY_SERVER_CERT, (void *)&enforce_tls);
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user