diff --git a/libmariadb/secure/openssl.c b/libmariadb/secure/openssl.c index 75b508923..6b23fd8a0 100644 --- a/libmariadb/secure/openssl.c +++ b/libmariadb/secure/openssl.c @@ -684,7 +684,7 @@ int ma_tls_verify_server_cert(MARIADB_TLS *ctls) return 1; } #ifdef HAVE_OPENSSL_CHECK_HOST - if (X509_check_host(cert, mysql->host, 0, 0, 0) != 1 + if (X509_check_host(cert, mysql->host, strlen(mysql->host), 0, 0) != 1 && X509_check_ip_asc(cert, mysql->host, 0) != 1) goto error; #else