Bug #74943 [NEW]: PHP Mysql connection with SSL is not working PDO

From: Date: Mon, 17 Jul 2017 19:26:35 +0000
Subject: Bug #74943 [NEW]: PHP Mysql connection with SSL is not working PDO
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-210095@lists.php.net to get a copy of this message
From: rnkhouse at gmail dot com Operating system: Ubuntu 16.04 PHP version: 7.1Git-2017-07-17 (snap) Package: PDO related Bug Type: Bug Bug description:PHP Mysql connection with SSL is not working PDO Description: ------------ Mysql server is running php5.3. New webserver is running php7.1 (migrated from php5.3). When I try to connect Mysql server with ssl its not working. try { $dbh = new PDO($dsn, $user, $password, array(PDO::MYSQL_ATTR_SSL_KEY => '/etc/mysql/client-key.pem', PDO::MYSQL_ATTR_SSL_CERT => '/etc/mysql/client-cert.pem', PDO::MYSQL_ATTR_SSL_CA => '/etc/mysql/ca-cert.pem') ); echo "Connestion established"; } catch (PDOException $e) { echo 'Connection failed: ' . $e->getMessage(); } >Connection failed: SQLSTATE[HY000] [2002] >PDO::__construct(): SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed But, When I remove SSL block from connection, its working fine. I don't know what's going on. May be version mismatch of server and client. Becasue I am using old public key and private key. Is it because of mysql client and server version mismatch? PS: I have upgraded php7 in webserver only. Actual result: -------------- PDO::__construct(): SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed -- Edit bug report at https://bugs.php.net/bug.php?id=74943&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=74943&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=74943&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=74943&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=74943&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=74943&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=74943&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=74943&r=needscript Try newer version: https://bugs.php.net/fix.php?id=74943&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=74943&r=support Expected behavior: https://bugs.php.net/fix.php?id=74943&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=74943&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=74943&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=74943&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74943&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=74943&r=dst IIS Stability: https://bugs.php.net/fix.php?id=74943&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=74943&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=74943&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=74943&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=74943&r=mysqlcfg

« previous php.bugs (#210095) next »