4

I am getting the following error when trying to connect from my Windows box to my Linux box:

Warning: PDO::__construct(): SSL operation failed with code 1. OpenSSL Error messages: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number

This is the connection code:

    $dbE = new PDO(
                    'mysql:dbname=db_name;host=host_ip;',
                    'username',
                    'password',
                    array(                                                                                     
                            PDO::MYSQL_ATTR_SSL_KEY         =>'client_side_path\client-key.pem',
                            PDO::MYSQL_ATTR_SSL_CERT        =>'client_side_path\client-cert.pem',
                            PDO::MYSQL_ATTR_SSL_CA          =>'client_side_path\ca-cert.pem'
                    )                                  
                   );
    $dbE->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

    echo 'Connected';  

Any ideas welcome.

Ukuser32
  • 2,147
  • 2
  • 22
  • 32

1 Answers1

2

Fixed it. The reason was because the path in Server B to the CA was incorrect. Its worth noting that to fix this I tried a connection outside of PHP directly from server A and it came up with an error "bad other signature confirmation" - I then loaded the CA cert and found it was empty. Rebooted the server, set the correct paths in both my.cnf and the server start call and all fixed. Really worth trying the mysql direct connection as it gave a very different error which was much more useful than the PDO one.

Ukuser32
  • 2,147
  • 2
  • 22
  • 32