com php-src: Fix mysqli ssl tests: ext/mysqli/tests/bug51647.phpt ext/mysqli/tests/bug55283.phpt

From: Date: Thu, 05 Dec 2019 07:38:40 +0000
Subject: com php-src: Fix mysqli ssl tests: ext/mysqli/tests/bug51647.phpt ext/mysqli/tests/bug55283.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-109390@lists.php.net to get a copy of this message
Commit: 6b7cb4a8d70cd3a4f153e5097f9c9caea3ed0b4d Author: Nikita Popov <nikita.ppv@gmail.com> Thu, 5 Dec 2019 08:37:52 +0100 Parents: ee4295b4ce421003c2e1d2af98066826deb23319 Branches: PHP-7.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6b7cb4a8d70cd3a4f153e5097f9c9caea3ed0b4d Log: Fix mysqli ssl tests First, make sure the tests are skipped if we connect via unix socket, as we can't use SSL in that case. Second, use a cipher that is not blacklisted in current MySQL versions. Changed paths: M ext/mysqli/tests/bug51647.phpt M ext/mysqli/tests/bug55283.phpt Diff: diff --git a/ext/mysqli/tests/bug51647.phpt b/ext/mysqli/tests/bug51647.phpt index 7385538fbbb..cd7ccf8017a 100644 --- a/ext/mysqli/tests/bug51647.phpt +++ b/ext/mysqli/tests/bug51647.phpt @@ -12,6 +12,9 @@ if ($IS_MYSQLND && !extension_loaded("openssl")) if (!($link = @my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))) die(sprintf("skip Connect failed, [%d] %s", mysqli_connect_errno(), mysqli_connect_error())); +if (false === strpos($link->host_info, 'TCP/IP')) + die(sprintf("skip SSL only supported on TCP/IP")); + $row = NULL; if ($res = $link->query('SHOW VARIABLES LIKE "have_ssl"')) { $row = $res->fetch_row(); diff --git a/ext/mysqli/tests/bug55283.phpt b/ext/mysqli/tests/bug55283.phpt index e7b16fdd13c..e70ba5f8c73 100644 --- a/ext/mysqli/tests/bug55283.phpt +++ b/ext/mysqli/tests/bug55283.phpt @@ -12,6 +12,9 @@ if ($IS_MYSQLND && !extension_loaded("openssl")) if (!($link = @my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))) die(sprintf("skip Connect failed, [%d] %s", mysqli_connect_errno(), mysqli_connect_error())); +if (false === strpos($link->host_info, 'TCP/IP')) + die(sprintf("skip SSL only supported on TCP/IP")); + $row = NULL; if ($res = $link->query('SHOW VARIABLES LIKE "have_ssl"')) { $row = $res->fetch_row(); @@ -36,14 +39,14 @@ $link->close(); ?> --FILE-- <?php - include "connect.inc"; + require_once "connect.inc"; $db1 = new mysqli(); $flags = MYSQLI_CLIENT_SSL | MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT; $link = mysqli_init(); - mysqli_ssl_set($link, null, null, null, null, "RC4-MD5"); + mysqli_ssl_set($link, null, null, null, null, "AES256-SHA"); if (my_mysqli_real_connect($link, 'p:' . $host, $user, $passwd, $db, $port, null, $flags)) { $r = $link->query("SHOW STATUS LIKE 'Ssl_cipher'"); var_dump($r->fetch_row()); @@ -51,7 +54,7 @@ $link->close(); /* non-persistent connection */ $link2 = mysqli_init(); - mysqli_ssl_set($link2, null, null, null, null, "RC4-MD5"); + mysqli_ssl_set($link2, null, null, null, null, "AES256-SHA"); if (my_mysqli_real_connect($link2, $host, $user, $passwd, $db, $port, null, $flags)) { $r2 = $link2->query("SHOW STATUS LIKE 'Ssl_cipher'"); var_dump($r2->fetch_row()); @@ -64,12 +67,12 @@ array(2) { [0]=> string(10) "Ssl_cipher" [1]=> - string(7) "RC4-MD5" + string(10) "AES256-SHA" } array(2) { [0]=> string(10) "Ssl_cipher" [1]=> - string(7) "RC4-MD5" + string(10) "AES256-SHA" } done

« previous php.cvs (#109390) next »