diff --git a/lib/MySQL_Monitor.cpp b/lib/MySQL_Monitor.cpp index e324f42782..dc63c1a991 100644 --- a/lib/MySQL_Monitor.cpp +++ b/lib/MySQL_Monitor.cpp @@ -182,7 +182,7 @@ static int wait_for_mysql(MYSQL *mysql, int status) { } static void close_mysql(MYSQL *my) { - if (my->net.pvio) { + if (my->net.pvio && !my->options.use_ssl) { char buff[5]; mysql_hdr myhdr; myhdr.pkt_id=0; diff --git a/lib/mysql_connection.cpp b/lib/mysql_connection.cpp index 0e5367edfc..d58a29f970 100644 --- a/lib/mysql_connection.cpp +++ b/lib/mysql_connection.cpp @@ -2958,7 +2958,7 @@ void MySQL_Connection::optimize() { // if avoids that a QUIT command stops forever // FIXME: currently doesn't support encryption and compression void MySQL_Connection::close_mysql() { - if ((send_quit) && (mysql->net.pvio) && ret_mysql) { + if ((send_quit) && (mysql->net.pvio) && ret_mysql && !mysql->options.use_ssl) { char buff[5]; mysql_hdr myhdr; myhdr.pkt_id=0;