我正在尝试使用以下代码建立到
MySQL服务器的SSL连接(在Debian GNU / Linux 7(wheezy)上使用
PHP 5.4.4):
$db = new PDO('mysql:host=mysql.myorganization.net;dbname=myDB',
'username', 'password', array(
PDO::MYSQL_ATTR_SSL_CA => 'mysqlCertificates/caChain.pem'
));
var_dump($db->query("SHOW STATUS LIKE 'Ssl_cipher';")->fetchAll());
但是我收到了这个错误:
SQLSTATE[HY000] [2026] SSL connection error: ASN: bad other signature confirmation
我可以使用mysql命令成功建立SSL连接:
mysql -u username -p -h mysql.myorganizataion.net --ssl-ca mysqlCertificates/caChain.pem
我还从源代码构建了PHP 5.4.4并且(没有运行make install)我跑了
sapi/cli/php ~/Projects/test.php
我得到以下输出
array(1) {
[0]=>
array(4) {
["Variable_name"]=>
string(10) "Ssl_cip