lundi 6 mai 2019

How to resolve Peer certificate not matching expected for a PDO connection?

I am trying to set up an SSL connection between application (Laravel) server and mysql 8 server. I have looked around for a solution and the most suggested solution is to set verify server cert to false which i have in my database config below.

But I seem to still be getting this error. Is there another corresponding setting somewhere else I need to check?

PDOException::("PDO::__construct(): Peer certificate CN=MySQL_Server_8.0.16_Auto_Generated_Server_Certificate did not matc h expected CN=`IPADDRESS'")

'options' => array_filter([
            PDO::MYSQL_ATTR_SSL_CA      => 'mysql_client_ssql/ca.pem',
            PDO::MYSQL_ATTR_SSL_CERT    => 'mysql_client_ssql/client-cert.pem',
            PDO::MYSQL_ATTR_SSL_KEY     => 'mysql_client_ssql/client-key.pem',
            PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT => false,
        ]),



via Chebli Mohamed

1 commentaire: