Google PHP API客户端:CA cert错误 [英] Google PHP API Client: CA cert error
问题描述
我尝试与Google PHP API用户端进行互动,而且我在使用Google提供的凭证时遇到问题:
Google错误: em>
SSL证书问题,请验证CA证书是否正确。
从google-api-php-client的CA证书包重试。
PHP cURL错误:
SSL证书问题:无法获取本地颁发者证书
我在Linux平台上遇到了无问题。
我尝试了几种不同的解决方案:
a href =https://code.google.com/p/google-api-php-client/wiki/FAQ> https://code.google.com/
http://richardwarrender.com/
但没有效果。非常感谢任何帮助!
提前感谢
Mike
> 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
允许 strong>,你不想要!I'm attempting to interface with the Google PHP API client and I am having issues with the certificate provided by Google:
Google error:
SSL certificate problem, verify that the CA cert is OK. Retrying with the CA cert bundle from google-api-php-client.
PHP cURL error:
SSL certificate problem: unable to get local issuer certificate
I had no problems whatsoever on a Linux box. These errors are occuring on a Windows box.
I've tried a couple of different solutions:
https://code.google.com/
http://richardwarrender.com/But to no avail. Any help is greatly appreciated!
Thanks in advance,
MikePS:
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
Won't be acceptable ...
解决方案Courtesy of rmckay at webaware dot com dot au:
Please everyone, stop setting CURLOPT_SSL_VERIFYPEER to false or 0. If your PHP installation doesn't have an up-to-date CA root certificate bundle, download the one at the curl website and save it on your server:
http://curl.haxx.se/docs/caextract.html
Then set a path to it in your
php.ini
file, e.g. on Windows:curl.cainfo=c:\php\cacert.pem
Turning off
CURLOPT_SSL_VERIFYPEER
allows man in the middle (MITM) attacks, which you don't want!这篇关于Google PHP API客户端:CA cert错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!