【问题标题】:Curl says SSL certificate is expired when it is notCurl 说 SSL 证书未过期时已过期
【发布时间】:2021-11-29 16:17:03
【问题描述】:

在我的服务器上使用 curl 访问我的其他服务器时,我收到以下响应:

curl: (60) SSL certificate problem: certificate has expired
More details here: https://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.

使用本地计算机上的 curl 或在浏览器中打开相同的 URL 会显示证书有效。问题似乎是由于letsencrypt shutting down support for an older root certificate。但我只是无法更新服务器的受信任根证书。
我尝试了update-ca-certificates -f -v 并通过wget https://curl.se/ca/cacert.pem -O /etc/ssl/certs/cacert.pem 手动下载更新的根证书,但没有任何效果。 有什么想法吗?

【问题讨论】:

    标签: php ssl curl certificate lets-encrypt


    【解决方案1】:

    由于信息不足,我无法确认原因,但您可以尝试以下步骤删除旧的 Let'sEncrypt CA:

    1. 检查 DST 根在 /etc/pki/tls/certs/ca-bundle.crt 和 ISRG 根 X1 在 ISRG 根 X1 中。
    2. 将“#DST Root CA X3”部分作为pem文件复制到/etc/pki/ca-trust/source/blacklist目录中
    3. 运行 update-ca-trust
    4. 检查 DST 根不在 /etc/pki/tls/certs/ca-bundle.crt,ISRG Root X1 在 ISRG Root X1。

    【讨论】:

    • 您好,感谢您的回答。遗憾的是我没有目录“/etc/pki”。您还需要哪些其他信息来确认原因?
    • 您的操作系统版本是多少?
    • Debian GNU/Linux 9 (stretch)
    • 要在 Debian 中删除 DST 根目录,您可以运行 sudo dpkg-reconfigure ca-certificates 并在 GUI 中取消选中 DST。您可以阅读 /usr/share/doc/ca-certificates/README.Debian 了解更多详情
    猜你喜欢
    • 2021-11-22
    • 2021-11-23
    • 2014-09-22
    • 2020-09-18
    • 2014-10-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多