From: fuxa_kos at unihost dot cz
Operating system: Linux
PHP version: 5.3.1
PHP Bug Type: MySQLi related
Bug description: ssl not working
Description:
------------
ssl connection not working, same code with 5.2.12 working well.
With reference to bug 49234, I have support [33] => ssl_set.
mysql client working well too.
mysql ... --ssl-ca=cert/mysql-cacert.pem --ssl-cert=cert/client-cert.pem
--ssl-key=cert/client-key.pem
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 116395
Server version: 5.0.90-community-log MySQL Community Edition (GPL)
mysql> SHOW STATUS LIKE 'Ssl_cipher';
+---------------+--------------------+
| Variable_name | Value |
+---------------+--------------------+
| Ssl_cipher | DHE-RSA-AES256-SHA |
+---------------+--------------------+
1 row in set (0.00 sec)
from phpinfo
mysqli
MysqlI Support => enabled
Client API library version => 5.1.42
Active Persistent Links => 0
Inactive Persistent Links => 0
Active Links => 0
Client API header version => 5.1.42
MYSQLI_SOCKET => /var/lib/mysql/mysql.sock
Directive => Local Value => Master Value
mysqli.allow_local_infile => Off => Off
mysqli.allow_persistent => On => On
mysqli.default_host => no value => no value
mysqli.default_port => 3306 => 3306
mysqli.default_pw => no value => no value
mysqli.default_socket => no value => no value
mysqli.default_user => no value => no value
mysqli.max_links => Unlimited => Unlimited
mysqli.max_persistent => Unlimited => Unlimited
mysqli.reconnect => Off => Off
Client is Mysql 5.1 and server is Mysql 5.0. But same for 5.0 Mysql
client. In case PHP 5.2 Mysql client is 5.0.
Reproduce code:
---------------
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
$mysqli = mysqli_init();
$mysqli->ssl_set('./cert/client-key.pem', './cert/client-cert.pem',
'./cert/mysql-cacert.pem', null, null);
$mysqli->real_connect('removed', '', '', '');
if ($r = $mysqli->query("SHOW STATUS LIKE 'Ssl_cipher'")) {
var_dump($r->fetch_row());
}
echo $mysqli->error."\n";
echo $mysqli->errno."\n";
Expected result:
----------------
something like this for Ssl_cipher
array(2) {
[0]=>
string(10) "Ssl_cipher"
[1]=>
string(18) "DHE-RSA-AES256-SHA"
}
and no errors.
Actual result:
--------------
Warning: mysqli::ssl_set(): invalid object or resource mysqli
with MYSQLI_CLIENT_SSL
Can't connect to MySQL server on 'removed' (113)
errno = 2003
without MYSQLI_CLIENT_SSL
Warning: mysqli::real_connect(): (28000/1045): Access denied for
user 'removed' (using password: YES)
errno = 1045
ssl_set() in this case returns NULL, not true as doc says.
--
Edit bug report at http://bugs.php.net/?id=51026&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=51026&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=51026&r=trysnapshot53
Try a snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=51026&r=trysnapshot60
Fixed in SVN:
http://bugs.php.net/fix.php?id=51026&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=51026&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=51026&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=51026&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=51026&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=51026&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=51026&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=51026&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=51026&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=51026&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=51026&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51026&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=51026&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=51026&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=51026&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=51026&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=51026&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=51026&r=mysqlcfg