Skip to content

Commit 80de759

Browse files
committed
Disable SSL in new libmariadb unless --mysql-ssl=on
The new libmariadb defaults to enabling SSL, which introduces backward compatibility issues. Moreover, certificate verification may be enforced, together with SSL, potentially breaking connections with MySQL and older MariaDB versions. Thus, disable both certificate validation (apparently there is no option for it at the moment) and SSL.
1 parent 71a02ba commit 80de759

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

cmake/BuildLibmariadb.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ list(APPEND _EXTRA_CMAKE_ARGS
4141
ENDIF()
4242

4343
set(LIBMARIADB_GIT_TAG
44-
v3.3.11
44+
v3.4.2
4545
CACHE
4646
STRING
4747
"Git tag of mariadb client library. Set to empty string to get most recent revision"

src/drivers/mysql/drv_mysql.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,11 @@ static int mysql_drv_real_connect(db_mysql_conn_t *db_mysql_con)
403403
#ifdef HAVE_MYSQL_OPT_SSL_MODE
404404
DEBUG("mysql_options(%p,%s,%d)", con, "MYSQL_OPT_SSL_MODE", args.ssl_mode);
405405
mysql_options(con, MYSQL_OPT_SSL_MODE, &args.ssl_mode);
406+
#else
407+
char bool_opt = 0;
408+
mysql_options(con, MYSQL_OPT_SSL_VERIFY_SERVER_CERT, &bool_opt);
409+
bool_opt = args.use_ssl;
410+
mysql_options(con, MYSQL_OPT_SSL_ENFORCE, &bool_opt);
406411
#endif
407412

408413
if (args.use_ssl)

0 commit comments

Comments
 (0)