Skip to content

Commit

Permalink
db_mysql: fix ssl enforcement for mysql < 5.7
Browse files Browse the repository at this point in the history
  • Loading branch information
razvancrainea committed Nov 25, 2024
1 parent 50bb911 commit 1e46a4b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/db_mysql/my_con.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,10 @@ int db_mysql_connect(struct my_con* ptr)
(tls_opts & MY_CON_TLS_CA_DIR) ? ptr->tls_dom->ca_directory:NULL,
(tls_opts & MY_CON_TLS_CIPHERS) ? ptr->tls_dom->ciphers_list:NULL);
}
#if (defined LIBMARIADB) || (MYSQL_VERSION_ID < 80000)
#ifdef LIBMARIADB
#if (MYSQL_VERSION_ID >= 50700 && MYSQL_VERSION_ID < 80000)
mysql_options(ptr->con, MYSQL_OPT_SSL_ENFORCE, (void *)&use_tls);
#endif
#else
tls_opts = (use_tls?SSL_MODE_PREFERRED:SSL_MODE_DISABLED);
mysql_options(ptr->con, MYSQL_OPT_SSL_MODE, (void *)&tls_opts);
Expand Down

0 comments on commit 1e46a4b

Please sign in to comment.