|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2018-08-07 07:42 UTC] requinix@php.net
-Status: Open
+Status: Feedback
[2018-08-07 07:42 UTC] requinix@php.net
[2018-08-07 09:07 UTC] michel at ingenie dot fr
[2018-08-07 21:29 UTC] requinix@php.net
-Status: Feedback
+Status: Duplicate
[2018-08-07 21:29 UTC] requinix@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 17:00:02 2025 UTC |
Description: ------------ When using SSL connection with mysqli, the use of openssl function to create a key disrupt the mysqli connection. Many thanks for your attention. Test script: --------------- <?php $mysqli = new mysqli(); $mysqli->ssl_set('/etc/mysql/ssl/client-key.pem','/etc/mysql/ssl/client-cert.pem','/etc/mysql/ssl/ca-cert.pem',null,null); $mysqli->options(MYSQLI_OPT_SSL_VERIFY_SERVER_CERT,false); $mysqli->real_connect('remote.host.com','login','password',null,null,null,MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT); // test SQL query : WORK FINE $mysqli->select_db('test'); $result = $mysqli->query('select * from test'); print_r($result->fetch_all()); // Create KEY $key = openssl_pkey_new(['digest_alg' => 'sha256','private_key_bits' => 1024,'private_key_type' => OPENSSL_KEYTYPE_RSA]); // test SQL query : FAIL $mysqli->select_db('test'); // this is line 19 $result = $mysqli->query('select * from test'); print_r($result->fetch_all()); Expected result: ---------------- Just a dump of returned array like for the first select. Actual result: -------------- PHP Warning: mysqli::select_db(): SSL operation failed with code 1. OpenSSL Error messages: error:0E06D06C:configuration file routines:NCONF_get_string:no value error:0E06D06C:configuration file routines:NCONF_get_string:no value error:0E06D06C:configuration file routines:NCONF_get_string:no value error:0E06D06C:configuration file routines:NCONF_get_string:no value in .../test_bug_mysql_ssl_openssl.php on line 19 Warning: mysqli::select_db(): SSL operation failed with code 1. OpenSSL Error messages: error:0E06D06C:configuration file routines:NCONF_get_string:no value error:0E06D06C:configuration file routines:NCONF_get_string:no value error:0E06D06C:configuration file routines:NCONF_get_string:no value error:0E06D06C:configuration file routines:NCONF_get_string:no value in .../test_bug_mysql_ssl_openssl.php on line 19 PHP Warning: mysqli::select_db(): MySQL server has gone away in .../test_bug_mysql_ssl_openssl.php on line 19 Warning: mysqli::select_db(): MySQL server has gone away in .../test_bug_mysql_ssl_openssl.php on line 19 PHP Warning: mysqli::select_db(): Error while reading INIT_DB's OK packet. PID=16092 in .../test_bug_mysql_ssl_openssl.php on line 19 Warning: mysqli::select_db(): Error while reading INIT_DB's OK packet. PID=16092 in .../test_bug_mysql_ssl_openssl.php on line 19 PHP Fatal error: Uncaught Error: Call to a member function fetch_all() on boolean in .../test_bug_mysql_ssl_openssl.php:21 Stack trace: #0 {main} thrown in .../test_bug_mysql_ssl_openssl.php on line 21 Fatal error: Uncaught Error: Call to a member function fetch_all() on boolean in .../test_bug_mysql_ssl_openssl.php:21 Stack trace: #0 {main} thrown in .../test_bug_mysql_ssl_openssl.php on line 21