当前位置:   article > 正文

宝塔面板6.8 php curl超时,宝塔面板计划任务定时访问https内容出现curl: (60) Peer’s Certificate has expired.的可能原因以及处理流程和解决办法...

curl: (60) peer's certificate has expired.

因为使用cloudreve需要设置一个定时任务,用来定时完成任务的处理。但是,今天访问后台,总是提示计划任务没有执行。但是我去宝塔面板看了一下,计划任务确实已经设置。于是查看执行日志,发现了这句话。curl: (60) Peer's Certificate has expired.,日志内容如下。

curl: (60) Peer's Certificate has expired.

More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"

of Certificate Authority (CA) public keys (CA certs). If the default

bundle file isn't adequate, you can specify an alternate file

using the --cacert option.

If this HTTPS server uses a certificate signed by a CA represented in

the bundle, the certificate verification probably failed due to a

problem with the certificate (it might be expired, or the name might

not match the domain name in the URL).

If you'd like to turn off curl's verification of the certificate, use

the -k (or --insecure) option.

TIM20190811173830.png-2

于是使用https出现curl: (60) Peer's Certificate has expired 关键词在百度上搜索,查找教程。所搜到的教程,大致就几种方法。

先是升级证书,

update-ca-trust

然后还可能是服务器时间的原因,使用如下代码校正时间

ntpdate pool.ntp.org

但是我使用了这两种办法,都无效。那么是不是我的https网址证书过期了呢?因为我使用的宝塔面板的 Let's Encrypt 免费证书,而且我记得建设这个网站时间也比较久了。于是我便登录宝塔面板一看,原来如此,我的证书8月5号就到期了,难怪访问的时候证书出问题。

TIM20190811173551.png-2

知道原因了,马上就续签 Let's Encrypt 。然后进入计划任务后台,查看日志

TIM20190811174014.png-2

这样就没什么问题了,计划任务正常执行。但是出现这个问题的原因是什么呢?原因就是在于通过宝塔面板申请的证书没有自动续签。按理说宝塔面板的网站使用的域名申请的ssl证书如果你的域名没有使用CDN的话会自动续签,但是据我观察这个自动续签并不是太可靠,建议大家定时检查ssl证书状态,以免自己证书过期。

另外还有一个原因大家可能好奇,为什么我的证书过期我访问这个网址却没发现呢?我分析我的实际访问环境好像是Adsafe的问题。谷歌内核的浏览器在系统安装adsafe时,从地址栏查看证书信息,我是adsafe签发的证书。有效期是从今天算一年有效期。

TIM20190811174949.png-2

这样可能会隐藏我的证书过期问题。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/weixin_40725706/article/detail/121946
推荐阅读
相关标签
  

闽ICP备14008679号