Bug #69524 [Com]: openssl-pkey-get-public() kill mysql(i) connection with ssl

From: Date: Mon, 02 May 2016 16:36:36 +0000
Subject: Bug #69524 [Com]: openssl-pkey-get-public() kill mysql(i) connection with ssl
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-200863@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69524&edit=1 ID: 69524 Comment by: roy at chameleon dot ad Reported by: js at xim dot de Summary: openssl-pkey-get-public() kill mysql(i) connection with ssl Status: Open Type: Bug Package: MySQLi related Operating System: Linux Debian PHP Version: 5.6.8 Block user comment: N Private report: N New Comment: I can confirm a similar issue when using openssl_public_encrypt If the mysql_conn has been opened before (and is using ssl) calling failing $mysqli->query() will fail with error PHP Warning: mysqli::query(): SSL operation failed with code 1. OpenSSL Error messages:\nerror:0906D06C:PEM routines:PEM_read_bio:no start line in XXXX on line 35\nPHP message: PHP Warning: mysqli::query(): MySQL server has gone away in XXXX on line 35\nPHP message: PHP Warning: mysqli::query(): Error reading result set's header in XXXX on line 35\n', referer: http://chameleon.ad/signup.php I am using php 5.6.18 Previous Comments: ------------------------------------------------------------------------ [2015-04-24 14:06:27] js at xim dot de Description: ------------ mysqli => Uptime: 453701 Threads: 2 Questions: 34649 Slow queries: 0 Opens: 299 Flush tables: 1 Open tables: 151 Queries per second avg: 0.076 mysqli => Resource id #10 Warning: mysqli::stat(): SSL operation failed with code 1. OpenSSL Error messages: error:0906D06C:PEM routines:PEM_read_bio:no start line in ~/test.php on line 17 Warning: mysqli::stat(): MySQL server has gone away in ~/test.php on line 17 mysqli => --------------------- php version 5.6.6 works but not after :( Test script: --------------- $mysqli = mysqli_init(); if(!$mysqli) { exit(1);} if(!$mysqli->real_connect('host', 'user', '*********', 'information_schema', 3306, NULL, MYSQLI_CLIENT_SSL)) { exit(2); } echo 'mysqli => ' . $mysqli->stat() . "\n"; $openssl_pkey_get_public = openssl_pkey_get_public('-----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA6ZkX4HXSiL5YPdaHeAIZ IsE+jOTdQQzl2R8geQuOB2ODtlSUzMSWEH1o4AQtdTdoQljdiUfoUQQUaMAVj4K9 QsPV8I+by3nhR2kkgjkobspnxfTbMnVkhNlAAeBOrVDO1OF32r/SWrHH1W+WnjRp g+60bAFvO06OEfVjOTlc4jJAuQq1BCuHalU88yb6wED6A9iP9FLQrQDtKUhTNXRe v/iBpCKTDGzakao6hJspNrw8sS2FsdzQ8TZdlJ4jTaT8DjMGYsu29Mrov0ybUk0D zG1Uk+os/0Bz1BnNcCIqRNuNQo5zjOOTE3DkK1Q9wse1TjEi/cCn74H9OWpSlYY3 CQIDAQAB -----END PUBLIC KEY-----'); echo 'mysqli => ' . print_r($openssl_pkey_get_public,true) . "\n"; echo 'mysqli => ' . $mysqli->stat() . "\n"; $mysqli->close(); ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=69524&edit=1

« previous php.bugs (#200863) next »