SSL options set by mysqli_ssl_set ignored for MySQLi persistent connections
| Bug #55283 | SSL options set by mysqli_ssl_set ignored for MySQLi persistent connections | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Submitted: | 2011-07-26 00:20 UTC | Modified: | 2017-10-24 06:13 UTC |
|
||||||||||
| From: | aleksey at wepay dot com | Assigned: | ||||||||||||
| Status: | Open | Package: | MySQLi related | |||||||||||
| PHP Version: | 5.3.6 | OS: | Cent OS | |||||||||||
| Private report: | No | CVE-ID: | None | |||||||||||
[2011-07-26 00:20 UTC] aleksey at wepay dot com
Description: ------------ The MySQLi ignores SSL options set with mysqli_ssl_set() for persistent connections (works fine for non-persistent connections). To reproduce: 1) Configure MySQL server with SSL support (http://dev.mysql.com/doc/refman/5.0/en/secure-connections.html) 2) Run the attached test script Test script: --------------- <? $host = 'localhost'; $user = 'root'; $pass = ''; $db = null; $port = 3306; $flags = MYSQLI_CLIENT_SSL; /* persistent connection */ $link = mysqli_init(); mysqli_ssl_set($link, null, null, null, null, "RC4-MD5"); if (mysqli_real_connect($link, 'p:' . $host, $user, $pass, $db, $port, null, $flags)) { $r = $link->query("SHOW STATUS LIKE 'Ssl_cipher'"); var_dump($r->fetch_row()); } /* non-persistent connection */ $link = mysqli_init(); mysqli_ssl_set($link, null, null, null, null, "RC4-MD5"); if (mysqli_real_connect($link, $host, $user, $pass, $db, $port, null, $flags)) { $r = $link->query("SHOW STATUS LIKE 'Ssl_cipher'"); var_dump($r->fetch_row()); } Expected result: ---------------- array(2) { [0]=> string(10) "Ssl_cipher" [1]=> string(18) "RC4-MD5" } array(2) { [0]=> string(10) "Ssl_cipher" [1]=> string(7) "RC4-MD5" } Actual result: -------------- array(2) { [0]=> string(10) "Ssl_cipher" [1]=> string(18) "DHE-RSA-AES256-SHA" } array(2) { [0]=> string(10) "Ssl_cipher" [1]=> string(7) "RC4-MD5" }
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2011-07-26 00:25 UTC] aleksey at wepay dot com
[2011-07-26 15:40 UTC] philip@php.net
-Assigned To: +Assigned To: mysql
[2011-08-05 11:53 UTC] uw@php.net
-Status: Assigned +Status: Verified
[2011-08-05 11:53 UTC] uw@php.net
Reproducible with PHP 5.3.7RC4-dev (cli) (built: Jul 26 2011 17:35:20) (DEBUG) using *libmysql* to connect to 5.1.45-debug-log Configure Command => './configure' '--with-mysql=mysqlnd' '--with-mysqli=/usr/local/mysql/bin/mysql_config' '--with-pdo-mysql=/usr/local/mysql/bin/mysql_config' '--enable-debug' '--enable-maintainer-zts' '--enable-mysqlnd-ms' '--enable-mysqlenterprise' '--enable-mysqlnd-uh' '--enable-pcntl' nixnutz@linux-fuxh:~/php/php-src/branches/PHP_5_3> sapi/cli/php bar.php array(2) { [0]=> string(10) "Ssl_cipher" [1]=> string(18) "DHE-RSA-AES256-SHA" } array(2) { [0]=> string(10) "Ssl_cipher" [1]=> string(7) "RC4-MD5" }[2011-08-05 13:17 UTC] uw@php.net
[2011-08-18 01:34 UTC] spam2 at rhsoft dot net
[2011-08-18 07:17 UTC] spam2 at rhsoft dot net
what try you to tell me with "I don't get your comment :(" remember that not everfybody has english as nmative language i need a way to revert this change to get PHP 5.3.7 working with mysqlnd/ssl the same way as it did the whole last year[2011-08-18 07:51 UTC] andrey@php.net
[2011-08-18 07:55 UTC] pajoye@php.net
[2011-09-02 11:22 UTC] uw@php.net
[2011-09-02 12:19 UTC] johannes@php.net
-Status: Verified +Status: Assigned -Assigned To: mysql +Assigned To: scottmac
[2011-09-02 12:19 UTC] johannes@php.net
[2011-09-02 12:48 UTC] spam2 at rhsoft dot net
[2015-07-10 11:33 UTC] spam2 at rhsoft dot net
[2015-07-10 13:21 UTC] spam2 at rhsoft dot net
[2017-10-24 06:13 UTC] kalle@php.net
-Status: Assigned +Status: Open -Assigned To: scottmac +Assigned To: