我正在尝试与 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 卷曲错误:
SSL certificate problem: unable to get local issuer certificate
I had noLinux 机器上的任何问题。这些错误发生在 Windows 机器上。
我尝试了几种不同的解决方案:
https://code.google.com/ https://code.google.com/p/google-api-php-client/wiki/FAQ
http://richardwarrender.com/ http://richardwarrender.com/2007/05/the-secret-to-curl-in-php-on-windows/
但无济于事。
PS:
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
不会被接受...
由 webaware dot com dot au 的 rmckay 提供:
请大家停止将 CURLOPT_SSL_VERIFYPEER 设置为 false 或 0。如果您的 PHP 安装没有最新的 CA 根证书捆绑包,请在curl 网站下载该证书并将其保存在您的服务器上:
http://curl.haxx.se/docs/caextract.html http://curl.haxx.se/docs/caextract.html
然后在你的中设置它的路径php.ini
文件,例如在 Windows 上:
curl.cainfo=c:\php\cacert.pem
关闭CURLOPT_SSL_VERIFYPEER
allows 中间人 (MITM) 攻击,这是你不想要的!
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)