Skip to content

Commit 398208f

Browse files
authored
Fix mariadbclient SSL support (#609)
1 parent ba85984 commit 398208f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: src/MySQLdb/_mysql.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -531,10 +531,11 @@ _mysql_ConnectionObject_Initialize(
531531
// See https://github.com/PyMySQL/mysqlclient/issues/474
532532
// TODO: Does MariaDB supports PREFERRED and VERIFY_CA?
533533
// We support only two levels for now.
534-
if (sslmode_num >= SSLMODE_REQUIRED) {
534+
my_bool enforce_tls = 1;
535+
if (ssl_mode_num >= SSLMODE_REQUIRED) {
535536
mysql_optionsv(&(self->connection), MYSQL_OPT_SSL_ENFORCE, (void *)&enforce_tls);
536537
}
537-
if (sslmode_num >= SSLMODE_VERIFY_CA) {
538+
if (ssl_mode_num >= SSLMODE_VERIFY_CA) {
538539
mysql_optionsv(&(self->connection), MYSQL_OPT_SSL_VERIFY_SERVER_CERT, (void *)&enforce_tls);
539540
}
540541
#endif

0 commit comments

Comments
 (0)