Fix regression enforcing TLS on MySQL connections

This commit is contained in:
Nicholas Hastings
2026-08-16 20:42:30 -04:00
parent a99a7a3d54
commit 7b2eaa5a6e
+7
View File
@@ -107,6 +107,13 @@ MYSQL *Connect(const DatabaseInfo *info, char *error, size_t maxlength)
mysql_options(mysql, MYSQL_OPT_READ_TIMEOUT, (const char *)&timeout);
mysql_options(mysql, MYSQL_OPT_WRITE_TIMEOUT, (const char *)&timeout);
/* MariaDB Connector/C 3.3.10 and newer enable server certificate
* verification by default, which requires TLS. Disabling it keeps
* legacy behavior of allowing unencrypted connections.
*/
bool verify_server_cert = false;
mysql_options(mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT, (const char *)&verify_server_cert);
/* Have MySQL automatically reconnect if it times out or loses connection.
* This will prevent "MySQL server has gone away" errors after a while.
*/