aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/database/Database/MySQLConnection.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/server/database/Database/MySQLConnection.cpp b/src/server/database/Database/MySQLConnection.cpp
index acb96fa5d71..47880c329e5 100644
--- a/src/server/database/Database/MySQLConnection.cpp
+++ b/src/server/database/Database/MySQLConnection.cpp
@@ -134,12 +134,21 @@ uint32 MySQLConnection::Open()
if (m_connectionInfo.ssl != "")
{
- my_bool opt_use_ssl = false;
+#if !defined(MARIADB_VERSION_ID) && MYSQL_VERSION_ID >= 80000
+ mysql_ssl_mode opt_use_ssl = SSL_MODE_DISABLED;
if (m_connectionInfo.ssl == "ssl")
{
- opt_use_ssl = true;
+ opt_use_ssl = SSL_MODE_REQUIRED;
+ }
+ mysql_options(mysqlInit, MYSQL_OPT_SSL_MODE, (char const*)&opt_use_ssl);
+#else
+ MySQLBool opt_use_ssl = MySQLBool(0);
+ if (m_connectionInfo.ssl == "ssl")
+ {
+ opt_use_ssl = MySQLBool(1);
}
mysql_options(mysqlInit, MYSQL_OPT_SSL_ENFORCE, (char const*)&opt_use_ssl);
+#endif
}
m_Mysql = reinterpret_cast<MySQLHandle*>(mysql_real_connect(mysqlInit, m_connectionInfo.host.c_str(), m_connectionInfo.user.c_str(),