Bug #74943 [Opn]: PHP Mysql connection with SSL is not working PDO
| From: | rnkhouse at gmail dot com | Date: | Mon, 17 Jul 2017 19:28:55 +0000 |
| Subject: | Bug #74943 [Opn]: PHP Mysql connection with SSL is not working PDO | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-210096@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74943&edit=1
ID: 74943
User updated by: rnkhouse at gmail dot com
Reported by: rnkhouse at gmail dot com
Summary: PHP Mysql connection with SSL is not working PDO
Status: Open
Type: Bug
Package: PDO related
Operating System: Ubuntu 16.04
-PHP Version: 7.1Git-2017-07-17 (snap)
+PHP Version: 7.1.7
Block user comment: N
Private report: N
New Comment:
version change
Previous Comments:
------------------------------------------------------------------------
[2017-07-17 19:26:27] rnkhouse at gmail dot com
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 this bug report at https://bugs.php.net/bug.php?id=74943&edit=1