php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #70063
Patch mysql-client-ssl-handling-when-disabled.patch revision 2015-07-13 12:11 UTC by dominic dot benson at thirdlight dot com

Patch mysql-client-ssl-handling-when-disabled.patch for MySQL related Bug #70063

Patch version 2015-07-13 12:11 UTC

Return to Bug #70063 | Download this patch
Patch Revisions:

Developer: dominic.benson@thirdlight.com

diff -rupN php-5.4.43.orig/ext/mysqlnd/mysqlnd.c php-5.4.43/ext/mysqlnd/mysqlnd.c
--- php-5.4.43.orig/ext/mysqlnd/mysqlnd.c	2015-07-07 23:08:15.000000000 +0100
+++ php-5.4.43/ext/mysqlnd/mysqlnd.c	2015-07-13 12:43:12.385500682 +0100
@@ -465,9 +465,9 @@ mysqlnd_switch_to_ssl_if_needed(
 		}
 	}
 #else
-	auth_packet->client_flags &= ~CLIENT_SSL;
-	if (!PACKET_WRITE(auth_packet, conn)) {
-		goto close_conn;
+	if (mysql_flags & CLIENT_SSL) {
+		php_error(E_WARNING, "Unable to connect to MySQL using SSL as this PHP was not built with support for it");
+		auth_packet->client_flags &= ~CLIENT_SSL;
 	}
 #endif
 	ret = PASS;
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Aug 01 02:01:24 2021 UTC