Google PHP API客户端:CA证书错误


Google PHP API Client: CA cert error

我正在尝试与Google PHP API客户端接口,但我对Google提供的证书有问题:

谷歌错误:

SSL certificate problem, verify that the CA cert is OK.
Retrying with the CA cert bundle from google-api-php-client. 

PHP cURL错误:

SSL certificate problem: unable to get local issuer certificate

我在Linux盒子上没有任何问题。这些错误发生在Windows盒子上。

我尝试了几种不同的解决方案:

https://code.google.com/
http://richardwarrender.com/

但无济于事。

PS:

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);  

不会被接受。。。

由rmckay在webaware dot-com dot-au:提供

请大家停止将CURLOPT_SSL_VERIFYPEER设置为false或0。如果您的PHP安装没有最新的CA根证书捆绑包,请在curl网站上下载该捆绑包并将其保存在您的服务器上:

http://curl.haxx.se/docs/caextract.html

然后在php.ini文件中设置它的路径,例如在Windows:上

curl.cainfo=c:'php'cacert.pem

关闭CURLOPT_SSL_VERIFYPEER允许中间人(MITM)攻击,这是您不想要的!

''Google_Client::$io->setOptions(数组(CURLOPT_SSL_VERIFYPEER=>FALSE));

@sKophek是正确的,我很感激在我努力解决这个问题时得到的帮助。对于那些更喜欢细节的人来说,这里是:(至少对于谷歌api php客户端的0.6.x版本来说是这样)

1) ''google api php客户端''src''io''google_CurlIO.php

2)private $curlParams = array ( ... CURLOPT_SSL_VERIFYPEER => false, ... );