Closed JamborYao closed 7 years ago
It's a troubleshooting article, so I still use the format just like "issue----solution"; And due to the article is too simple, I add the content about "Why me meet the error" and "some discription about CA which we use in solution" to rich the article. Please help me to confirm whether it's suitable.
问题描述
在使用 PHP 的 http 客户端工具(如 Guzzle)调用认知服务时出现证书认证问题,错误信息如下:
Fatal error: Uncaught exception 'GuzzleHttp\Exception\RequestException' with message 'cURL error 60: SSL certificate problem: unable to get local issuer certificate
解决方法
此问题的出现是由于没有配置信任的服务器 HTTPS 验证。默认, cURL 被设为不信任任何 CAs,因此,这就是无法访问相关服务器的原因。解决该问题的最好方法是指定一组默认的受信任的 CAs。
所以此问题可以通过下载证书的方式进行解决,具体操作方法如下:
curl.cainfo =<filepath>/cacert.pem
Please consider to use a new template to write this type article. not use the same structure with op's.