关于php:2022818-cURL-error-60-SSL-certificate-problem

56次阅读

共计 975 个字符,预计需要花费 3 分钟才能阅读完成。

cURL error 60: SSL certificate problem: unable to get local issuer certificate

一、前言

明天在批改接手的企业微信音讯推送需要的时候,业务逻辑都理清了,但就是收不到推送。发送音讯的包用的是 overtrue 大佬的 easyWeChat,一开始想着是怎么实现音讯推送的,然而前面认真想想,这个包必定是通过大家的测验的,必定不是包的问题。所以就回到了发送音讯的代码上:

...
try{// 音讯推送...}catch(\Exception $exception){Log::error('企业微信发送音讯谬误:' ...);
}
...

如果发送失败,就会把抛出异样的谬误音讯写到日志中。

查看日志,音讯推送的报错如下:

企业微信发送音讯谬误: 
cURL error 60: SSL certificate problem: unable to get local issuer certificate 
(see https://curl.haxx.se/libcurl/c/libcurl-errors.html) 
for https://qyapi.weixin.qq.com/cgi-bin/...

查资料后得悉,这个谬误是因为 没有配置信赖的服务器 HTTPS 验证

CURLE_PEER_FAILED_VERIFICATION (60)

The remote server’s SSL certificate or SSH md5 fingerprint was deemed not OK. This error code has been unified with CURLE_SSL_CACERT since 7.62.0. Its previous value was 51.

二、解决办法

参考《解决 cURL error 60: SSL certificate problem: unable to get local issuer certificate 问题》

参考资料:

  1. 解决 cURL error 60: SSL certificate problem: unable to get local issuer certificate 问题 |☆☆☆☆
  2. cURL error 60: SSL certificate problem: unable to get local issuer certificate|☆☆☆
  3. libcurl error codes|☆☆☆

注:五角星代表权重。

正文完
 0