From:
Operating system: Linux
PHP version: 5.3.6
Package: MySQL related
Bug Type: Bug
Bug description:mysqlnd doesn't connect using ssl
Description:
------------
mysqlnd doesn't connect using ssl, see Test script
PHP compiled with
'--with-mysql=/usr' \
'--with-mysqli=/usr/bin/mysql_config' \
works fine
but with
'--with-mysql=mysqlnd' \
'--with-mysqli=mysqlnd' \
doesn't work. from phpinfo mysqlnd part:
SSL supported
Connect via mysql client works fine too
mysql --ssl-ca=mysql-cacert.pem --ssl-cert=client-cert.pem
--ssl-key=client-key.pem -h some-mysql-55-server
Local client and libraries are
MySQL-client-community-5.1.58-1.rhel5
MySQL-devel-community-5.1.58-1.rhel5
MySQL-shared-compat-5.5.15-1.rhel5
and same problem with
MySQL-shared-compat-5.1.58-1.rhel5
Target Mysql server (and all libraries and bin's) is 5.5.13.
System: CentOS release 5.6 (Final) in up2date state
Linux camel5 2.6.18-238.19.1.el5 #1 SMP Fri Jul 15 07:31:24 EDT 2011 x86_64
x86_64 x86_64 GNU/Linux
Test script:
---------------
var_dump($mirm = mysqli_init());
var_dump($mirm->ssl_set('client-key.pem', 'client-cert.pem',
'mysql-cacert.pem', null, null));
var_dump($mirm->real_connect('some-mysql-55-server', ...));
var_dump($mirm->error);
var_dump($mirm->errno);
Expected result:
----------------
this is working result from mysql legacy driver
object(mysqli)#3 (17) {
["affected_rows"]=>
NULL
["client_info"]=>
string(6) "5.1.58"
["client_version"]=>
int(50158)
["connect_errno"]=>
int(0)
["connect_error"]=>
NULL
["errno"]=>
int(0)
["error"]=>
string(0) ""
["field_count"]=>
NULL
["host_info"]=>
NULL
["info"]=>
NULL
["insert_id"]=>
NULL
["server_info"]=>
NULL
["server_version"]=>
NULL
["sqlstate"]=>
NULL
["protocol_version"]=>
NULL
["thread_id"]=>
NULL
["warning_count"]=>
NULL
}
bool(true)
bool(true)
string(0) ""
int(0)
Actual result:
--------------
this is failed result from mysqlnd driver
object(mysqli)#3 (17) {
["affected_rows"]=>
NULL
["client_info"]=>
string(50) "mysqlnd 5.0.8-dev - 20102224 - $Revision: 308673 $"
["client_version"]=>
int(50008)
["connect_errno"]=>
int(0)
["connect_error"]=>
NULL
["errno"]=>
int(0)
["error"]=>
string(0) ""
["field_count"]=>
NULL
["host_info"]=>
NULL
["info"]=>
NULL
["insert_id"]=>
NULL
["server_info"]=>
NULL
["server_version"]=>
NULL
["sqlstate"]=>
NULL
["protocol_version"]=>
NULL
["thread_id"]=>
NULL
["warning_count"]=>
NULL
}
bool(true)
bool(false) !!!!!!
string(0) ""
int(0)
--
Edit bug report at https://bugs.php.net/bug.php?id=55385&edit=1
--
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=55385&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=55385&r=trysnapshot53
Try a snapshot (trunk):
https://bugs.php.net/fix.php?id=55385&r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=55385&r=fixed
Fixed in SVN and need be documented:
https://bugs.php.net/fix.php?id=55385&r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=55385&r=alreadyfixed
Need backtrace:
https://bugs.php.net/fix.php?id=55385&r=needtrace
Need Reproduce Script:
https://bugs.php.net/fix.php?id=55385&r=needscript
Try newer version:
https://bugs.php.net/fix.php?id=55385&r=oldversion
Not developer issue:
https://bugs.php.net/fix.php?id=55385&r=support
Expected behavior:
https://bugs.php.net/fix.php?id=55385&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=55385&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=55385&r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=55385&r=globals
PHP 4 support discontinued:
https://bugs.php.net/fix.php?id=55385&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=55385&r=dst
IIS Stability:
https://bugs.php.net/fix.php?id=55385&r=isapi
Install GNU Sed:
https://bugs.php.net/fix.php?id=55385&r=gnused
Floating point limitations:
https://bugs.php.net/fix.php?id=55385&r=float
No Zend Extensions:
https://bugs.php.net/fix.php?id=55385&r=nozend
MySQL Configuration Error:
https://bugs.php.net/fix.php?id=55385&r=mysqlcfg