I am attempting to connect to a Rackspace Cloud MySQL database with PDO and SSL. My connection string is:
$dbh = new PDO($serverAddress, $username, $password, array(
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
PDO::MYSQL_ATTR_SSL_CA =>'rackspace.pem',
PDO::MYSQL_ATTR_SSL_KEY => 'key.pem',
PDO::MYSQL_ATTR_SSL_CERT => 'cert.pem'
));
This errors out with the message "PDO::__construct(): SSL operation failed with code 1. OpenSSL Error messages: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number"
rackspace.pem is the Rackspace CA file provided here. key.pem and cert.pem are self-signed certificates (with the same FQDN as rackspace.pem). This connection works successfully without SSL.
I have enabled SSLv3 in the Apache configuration of my server (not sure if that is relevant here, as it is a PDO-calling-openssl issue).
I am able to connect to the DB instance via the mysql client. There, I see that the SSL version is TLSv1 (wondering if that is part of the issue, somehow?).
The things I have read about this error message (some examples - Error 0x1408F10B: “SSL3_GET_RECORD:wrong version number” with PayPal SDK, how to solve SSL3_GET_RECORD:wrong version number error?) are not relevant to the PDO library.
Any help or direction would be much appreciated! Thanks!
