Gab*_*oux 15 debian certificate root-certificate lets-encrypt
这与DST Root CA X3 过期(2021 年 9 月)
有关\n当在线搜索适用于旧服务器(在我的例子中是 Debian 8)的修复程序时,该服务器确实调用使用 LetsEncrypt 加密的站点curl,现在它们似乎失败了,并显示以下内容信息:
例子:
\ncurl -fsSL https://deb.nodesource.com/setup_14.x | bash -\nRun Code Online (Sandbox Code Playgroud)\n无提示地失败,然后手动尝试并删除无提示标志和 bash 管道,如下所示:
\ncurl -L https://deb.nodesource.com/setup_14.x\nRun Code Online (Sandbox Code Playgroud)\ncurl: (60) SSL certificate problem: certificate has expired\nMore details here: http://curl.haxx.se/docs/sslcerts.html\n\ncurl performs SSL certificate verification by default, using a "bundle"\n of Certificate Authority (CA) public keys (CA certs). If the default\n bundle file isn\'t adequate, you can specify an alternate file\n using the --cacert option.\nIf this HTTPS server uses a certificate signed by a CA represented in\n the bundle, the certificate verification probably failed due to a\n problem with the certificate (it might be expired, or the name might\n not match the domain name in the URL).\nIf you\'d like to turn off curl\'s verification of the certificate, use\n the -k (or --insecure) option.\nRun Code Online (Sandbox Code Playgroud)\n尝试以下命令无法解决问题:
\napt update\napt install -y ca-certificates openssl\nupdate-ca-certificates\nRun Code Online (Sandbox Code Playgroud)\n我能做些什么!?(回答我自己的问题)\xe2\xac\x87\xef\xb8\x8f
\nGab*_*oux 26
免责声明;我不是安全专家(我知道一些事情,但你知道)。在应用此处共享的任何修复之前,请确保您了解自己所做的事情
升级您的实例。这个问题在 Debian 9 或更高版本上不会发生。
在下面的示例中,我在ruby:2.4.1基于 Debian 8(可以认为是旧版本)的 docker 映像上遇到了这个问题。升级到更新的 docker 映像可以解决此问题。升级到更新的 Debian 版本也应该可以解决该问题。
我确认使用基于 Debian 11 的 docker 镜像时不会发生这种情况,ruby:2.7.0如下所示:
docker run --rm -it ruby:2.7.4 bash -c "cat /etc/issue"
Debian GNU/Linux 11 \n \l
Run Code Online (Sandbox Code Playgroud)
即使ISRG Root X1已就位,如果DST Root 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与上面相同,但直接在您的实例上使用脚本
cat /etc/issue
Debian GNU/Linux 8 \n \l
Run Code Online (Sandbox Code Playgroud)
sudo apt install -y ca-certificates
sudo sed -i '/^mozilla\/DST_Root_CA_X3.crt$/ s/^/!/' /etc/ca-certificates.conf
sudo update-ca-certificates
Run Code Online (Sandbox Code Playgroud)
修复示例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/*
Run Code Online (Sandbox Code Playgroud)
如评论中所述,您还可以在实例上使用以下命令以交互方式修复此问题(需要ca-certificates安装软件包):
dpkg-reconfigure ca-certificates
Run Code Online (Sandbox Code Playgroud)
然后mozilla/DST_Root_CA_X3.crt从列表中禁用。
如果您想了解更多信息,您应该阅读Scott Helme 的帖子:Let's Encrypt 的根证书即将过期!
您现在可以curl使用这些防护眼镜安全地加密站点:
| 归档时间: |
|
| 查看次数: |
15099 次 |
| 最近记录: |