gpt4 book ai didi

debian - 如何强制较旧的 debian 忘记 DST Root CA X3 Expiration 并使用 ISRG Root X1 - SSL 证书问题 : certificate has expired

转载 作者:行者123 更新时间:2023-12-04 11:52:17 27 4
gpt4 key购买 nike

这与 DST Root CA X3 Expiration (September 2021) 有关
当在线搜索修复程序以应用于旧服务器(在我的情况下为 Debian 8)时,该服务器确实调用了使用 letencrypt 加密的站点 curl ,它们现在似乎失败并显示以下消息:
例子:

curl -fsSL https://deb.nodesource.com/setup_14.x | bash -
静默失败,然后手动尝试并删除静默标志和 bash 管道,如下所示:
curl -L https://deb.nodesource.com/setup_14.x
curl: (60) SSL certificate problem: 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.
尝试以下命令并不能解决问题:
apt update
apt install -y ca-certificates openssl
update-ca-certificates
我能做什么!? (回答我自己的问题)⬇️

最佳答案

免责声明;我不是安全专家(我知道一些事情,但你知道)。在应用此处共享的任何修复之前,请确保您了解自己的操作
通过升级您的实例来修复
升级您的实例。这个问题不会在 debian 9 或更高版本上发生。
在下面的例子中,我在 ruby:2.4.1 上遇到了这个问题。基于 Debian 8 的 docker 镜像(可能被认为是旧的)。升级到更新的 docker 镜像可以解决这个问题。升级到更新的 Debian 版本也应该可以解决这个问题。
我确认使用 ruby:2.7.0 时不会发生这种情况基于 Debian 11 的 docker 镜像如下所示:

docker run --rm -it ruby:2.7.4 bash -c "cat /etc/issue"
Debian GNU/Linux 11 \n \l
通过评论/etc/ca-certificates.conf 中的 DST_Root_CA_X3.crt 修复 Debian 8
即使 ISRG 根 X1 到位,如果 DST 根 CA X3 仍然存在并在使用中,它的验证似乎首先发生,所以我们可以通过这样做来摆脱它:
  • 安装 ca-certificates包裹
  • 评论 /mozilla/DST_Root_CA_X3.crt来自 /etc/ca-certificates.conf
  • 确保 /usr/share/ca-certificates/mozilla/ISRG_Root_X1.crt有吗(应该有)
  • 使用 update-ca-certificates 更新 ca 证书

  • 直接在您的实例上的示例
    cat /etc/issue
    Debian GNU/Linux 8 \n \l
    sudo apt install -y ca-certificates
    sudo sed -i '/^mozilla\/DST_Root_CA_X3.crt$/ s/^/!/' /etc/ca-certificates.conf
    sudo update-ca-certificates
    示例 Dockerfile :
    FROM ruby:2.4.1 # uses debian 8

    RUN apt update -qq \
    && apt install -y ca-certificates \
    && sed -i '/^mozilla\/DST_Root_CA_X3.crt$/ s/^/!/' /etc/ca-certificates.conf \
    && update-ca-certificates \
    && rm -rf /var/lib/apt/lists/*
    使用 dpkg-reconfigure ca-certificates 修复
    如评论中所述,您还可以在实例上使用以下命令以交互方式修复此问题(需要安装 ca-certificates 软件包):
    dpkg-reconfigure ca-certificates
    然后禁用 mozilla/DST_Root_CA_X3.crt从列表中。
    结论
    如果您想了解更多信息,请阅读 Scott Helme's post: Let's Encrypt's Root Certificate is expiring!
    您现在可以 curl让我们使用这些安全眼镜安全地加密站点:🥽

    关于debian - 如何强制较旧的 debian 忘记 DST Root CA X3 Expiration 并使用 ISRG Root X1 - SSL 证书问题 : certificate has expired,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69408776/

    27 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com