今天在本地使用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