今天在本地使用curl请求微信公众平台获取access_token接口时发现报以下错误:
cURL error 60: SSL certificate problem: unable to get local issuer certificatephp
缘由是由于请求的接口地址是一https开头,而我本地因为没有配置信任的服务器HTTPS验证因此报错。nginx
经过从其它地方搜索得出的解决方案是:
从github上下载一份秘钥文件放在你本地。
下载地址:https://github.com/bagder/ca-...git
由于我是windows,这里我将此文件放在:D:/curlcrt/ca-bundle/ca-bundle.crtgithub
修改你的php.ini文件,在php.ini中搜索curl.cainfo
修改后内容:
curl.cainfo=D:/curlcrt/ca-bundle/ca-bundle.crtapache
保存并重启你的nginx或apachewindows