如何强制旧版Debian忘记DST Root CA X3过期并使用ISRG Root X1-SSL证书问题:证书已过期 [英] How to force older debian to forget about DST Root CA X3 Expiration and use ISRG Root X1 - SSL certificate problem: certificate has expired

查看:54
本文介绍了如何强制旧版Debian忘记DST Root CA X3过期并使用ISRG Root X1-SSL证书问题:证书已过期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这与DST Root CA X3 Expiration (September 2021)
相关 当在线搜索要在旧服务器(我的例子是Debian 8)上应用的修补程序时,如果该服务器确实调用了使用curlletscrypt加密的站点,则现在似乎失败了,并显示以下消息:

示例:

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或更高版本上不会发生。

在下面的示例中,我在基于Debian 8的ruby:2.4.1docker映像上遇到了这个问题(可以认为是旧的)。升级到较新的坞站映像可以解决此问题。升级到更新的Debian版本也可以解决此问题。

我确认在使用基于Debian 11的ruby:2.7.0docker镜像时没有出现这种情况,如下所示:

docker run --rm -it ruby:2.7.4 bash -c "cat /etc/issue"
Debian GNU/Linux 11 
 l

通过注释/etc/ca-certificates.conf中的DST_Root_CA_X3.crt修复Debian 8

即使ISRG Root X1已经存在,如果DST Root CA X3仍然存在并在使用中,它的验证似乎会先进行,因此我们可以通过执行以下操作来消除它:

  1. 安装ca-certificates软件包
  2. 评论/mozilla/DST_Root_CA_X3.crt来自/etc/ca-certificates.conf
  3. 确保/usr/share/ca-certificates/mozilla/ISRG_Root_X1.crt存在(应该存在)
  4. 使用update-ca-certificates更新ca证书

直接在您的实例上使用示例

cat /etc/issue
Debian GNU/Linux 8 
 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修复-重新配置ca证书

如评论中所述,您也可以在实例上使用以下命令交互修复此问题(需要安装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使用这些安全眼镜curl对站点进行安全加密:🥽

这篇关于如何强制旧版Debian忘记DST Root CA X3过期并使用ISRG Root X1-SSL证书问题:证书已过期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆