From 57852875f1dfd2a16394e0bd0979219b285a4b57 Mon Sep 17 00:00:00 2001 From: Julius Goryavsky Date: Thu, 27 Oct 2022 13:25:35 +0200 Subject: [PATCH] MDEV-29817: Issues with handling options for SSL CRLs (and some others) This commit fixes a bug related to reading the value of the ssl_cipher instead of ssl_crl, and also adds handling of the forgotten tls_version option. --- libmariadb/mariadb_lib.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libmariadb/mariadb_lib.c b/libmariadb/mariadb_lib.c index f9d1d308..33cf749c 100644 --- a/libmariadb/mariadb_lib.c +++ b/libmariadb/mariadb_lib.c @@ -3911,11 +3911,15 @@ mysql_get_optionv(MYSQL *mysql, enum mysql_option option, void *arg, ...) *((char **)arg)= mysql->options.ssl_cipher; break; case MYSQL_OPT_SSL_CRL: - *((char **)arg)= mysql->options.extension ? mysql->options.ssl_cipher : NULL; + *((char **)arg)= mysql->options.extension ? mysql->options.extension->ssl_crl : NULL; break; case MYSQL_OPT_SSL_CRLPATH: *((char **)arg)= mysql->options.extension ? mysql->options.extension->ssl_crlpath : NULL; break; + case MARIADB_OPT_TLS_VERSION: + case MYSQL_OPT_TLS_VERSION: + *((char **)arg)= mysql->options.extension ? mysql->options.extension->tls_version : NULL; + break; case MYSQL_OPT_CONNECT_ATTRS: /* mysql_get_optionsv(mysql, MYSQL_OPT_CONNECT_ATTRS, keys, vals, elements) */ {