Skip to content

Commit ecc5fcb

Browse files
palichoroba
authored andcommitted
Fix SSL options for MySQL 8.3.0+ client library
MySQL 8.3.0 client library removed mysql_ssl_set() function. Replacement is mysql_options() function with appropriate arguments. This change fixes compilation with MySQL 8.3.0+ client library. See: https://dev.mysql.com/doc/relnotes/mysql/8.3/en/news-8-3-0.html#mysqld-8-3-0-deprecation-removal
1 parent 65a80d2 commit ecc5fcb

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

dbdimp.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2147,8 +2147,20 @@ static bool mariadb_dr_connect(
21472147
}
21482148
}
21492149

2150+
#if !defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 80300
2151+
if (mysql_options(sock, MYSQL_OPT_SSL_KEY, client_key) != 0 ||
2152+
mysql_options(sock, MYSQL_OPT_SSL_CERT, client_cert) != 0 ||
2153+
mysql_options(sock, MYSQL_OPT_SSL_CA, ca_file) != 0 ||
2154+
mysql_options(sock, MYSQL_OPT_SSL_CAPATH, ca_path) != 0 ||
2155+
mysql_options(sock, MYSQL_OPT_SSL_CIPHER, cipher) != 0) {
2156+
mariadb_dr_do_error(dbh, CR_SSL_CONNECTION_ERROR, "SSL connection error: Setting SSL options failed", "HY000");
2157+
mariadb_db_disconnect(dbh, imp_dbh);
2158+
return FALSE;
2159+
}
2160+
#else
21502161
mysql_ssl_set(sock, client_key, client_cert, ca_file,
21512162
ca_path, cipher);
2163+
#endif
21522164

21532165
if (ssl_verify && !(ca_file || ca_path)) {
21542166
mariadb_dr_do_error(dbh, CR_SSL_CONNECTION_ERROR, "SSL connection error: mariadb_ssl_verify_server_cert=1 is not supported without mariadb_ssl_ca_file or mariadb_ssl_ca_path", "HY000");

0 commit comments

Comments
 (0)