From db0a0fef64f3572fcf31753e09acf1f167113e4f Mon Sep 17 00:00:00 2001 From: Exynox Date: Sat, 16 Nov 2024 19:14:16 +0000 Subject: [PATCH] Disabled SSL enforcement in libmariadb --- src/libsql/src/CAsyncSQL.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/libsql/src/CAsyncSQL.cpp b/src/libsql/src/CAsyncSQL.cpp index 6a1ac11..1977451 100644 --- a/src/libsql/src/CAsyncSQL.cpp +++ b/src/libsql/src/CAsyncSQL.cpp @@ -132,6 +132,14 @@ bool CAsyncSQL::Connect() } } + // Disable MYSQL_OPT_SSL_VERIFY_SERVER_CERT (enabled by default in libmariadb >=3.4) + bool verifyServerCert = false; + if (mysql_options(&m_hDB, MYSQL_OPT_SSL_VERIFY_SERVER_CERT, &verifyServerCert) != 0) + { + SPDLOG_ERROR("Disabling MYSQL_OPT_SSL_VERIFY_SERVER_CERT failed: {}", mysql_error(&m_hDB)); + return false; + } + if (!mysql_real_connect(&m_hDB, m_stHost.c_str(), m_stUser.c_str(), m_stPassword.c_str(), m_stDB.c_str(), m_iPort, NULL, CLIENT_MULTI_STATEMENTS)) { SPDLOG_ERROR("MySQL connection failed: {}", mysql_error(&m_hDB));