summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorunknown <msvensson@pilot.blaudden>2007-03-27 19:26:01 +0200
committerunknown <msvensson@pilot.blaudden>2007-03-27 19:26:01 +0200
commitf7acb850c29dc06219da2a51d2da0a55d389df60 (patch)
treef45054ea92c121c58ca97cd9fd6f3df4a3cf2f5f /client
parent9b2e0127f02209a6e93fb3dcf2755b7abaf1d097 (diff)
downloadmariadb-git-f7acb850c29dc06219da2a51d2da0a55d389df60.tar.gz
Bug#24121 Incorrect test for SSL_VERIFY_SERVER_CERT
- Interpret the pointer passed to 'mysql_options' for MYSQL_OPT_SSL_VERIFY_SERVER_CERT as a my_bool - In 5.1 the mysql_options signature will be chanegd to take a 'void*' in order to further emphasize the need for a pointer to correct type client/mysqltest.c: Turn on ssl_verify_server_cert for all connections to "localhost" in mysqltest sql-common/client.c: The pointer passed to 'mysql_options' for MYSQL_OPT_SSL_VERIFY_SERVER_CERT should be interpreted as a my_bool pointer (aka char*).
Diffstat (limited to 'client')
-rw-r--r--client/mysqltest.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/client/mysqltest.c b/client/mysqltest.c
index 30f95dd4340..568d33f7385 100644
--- a/client/mysqltest.c
+++ b/client/mysqltest.c
@@ -3534,7 +3534,7 @@ void do_connect(struct st_command *command)
opt_ssl_capath, opt_ssl_cipher);
#if MYSQL_VERSION_ID >= 50000
/* Turn on ssl_verify_server_cert only if host is "localhost" */
- opt_ssl_verify_server_cert= !strcmp(ds_connection_name.str, "localhost");
+ opt_ssl_verify_server_cert= !strcmp(ds_host.str, "localhost");
mysql_options(&next_con->mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
&opt_ssl_verify_server_cert);
#endif
@@ -6002,15 +6002,13 @@ int main(int argc, char **argv)
#ifdef HAVE_OPENSSL
-#if MYSQL_VERSION_ID >= 50000
- opt_ssl_verify_server_cert= TRUE; /* Always on in mysqltest */
-#endif
-
if (opt_use_ssl)
{
mysql_ssl_set(&cur_con->mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher);
#if MYSQL_VERSION_ID >= 50000
+ /* Turn on ssl_verify_server_cert only if host is "localhost" */
+ opt_ssl_verify_server_cert= opt_host && !strcmp(opt_host, "localhost");
mysql_options(&cur_con->mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
&opt_ssl_verify_server_cert);
#endif