在 Ubuntu 14.04 上更新证书和 OpenSSL 并且仍然收到过期的 LetsEncrypt 证书错误?

在 Ubuntu 14.04 上更新证书和 OpenSSL 并且仍然收到过期的 LetsEncrypt 证书错误?

在我的办公室中,其中一个系统仍在运行 Ubuntu 14.04。该系统受到 Let's Encrypt 过期根证书问题的影响:

https://letsencrypt.org/docs/dst-root-ca-x3-expiration-september-2021/

我按照此处的说明手动下载了最新的证书:

https://askubuntu.com/questions/1366704/how-to-install-latest-ca-certificates-on-ubuntu-14

# Ensure dependencies
sudo apt install make tar wget

# Make a place to build it in
mkdir -p ~/src
cd ~/src
wget https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/ca-certificates/20210119~20.04.2/ca-certificates_20210119~20.04.2.tar.xz    
tar -xJf ca-certificates_20210119~20.04.2.tar.xz

# Now build and install
cd ca-certificates-20210119~20.04.1
make
sudo make install

# You might want to run this interactively to ensure
# you can select the ISRG Root X1
# in which case, just run: sudo dpkg-reconfigure ca-certificates
sudo dpkg-reconfigure -fnoninteractive ca-certificates
sudo update-ca-certificates --fresh --verbose
/usr/bin/c_rehash /etc/ssl/certs

我按照此处的步骤删除了“DST Root CA X3”并确保已启用“ISRG_Root_X1”证书:

https://jay.gooby.org/2021/09/30/remove-the-dst-root-ca-x3-crt-from-ubuntu-14-04-lts

# Also available at https://askubuntu.com/a/1366719/233579
mkdir -p ~/src
cd ~/src
wget https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/ca-    certificates/20210119~20.04.2/ca-certificates_20210119~20.04.2.tar.xz
unxz ca-certificates_20210119~20.04.2.tar.xz
tar -xf ca-certificates_20210119~20.04.2.tar
cd ca-certificates-20210119~20.04.1
make
sudo make install
sudo dpkg-reconfigure -fnoninteractive ca-certificates
sudo update-ca-certificates 

我重新启动以确保无误。但错误仍然出现。然后我openssl按照以下说明手动从 1.0.2 更新到 1.1.0:

https://forums.servethehome.com/index.php?resources/installing-openssl-1-1-0-on-ubuntu.21/

# I had to use the --no-check-certificate flag because openssl's certificate
#  is issued by LetsEncrypt
wget https://www.openssl.org/source/openssl-1.1.0e.tar.gz --no-check-certificate
tar xzvf openssl-1.1.0e.tar.gz
cd openssl-1.1.0e
./config -Wl,--enable-new-dtags,-rpath,'$(LIBRPATH)'
make
sudo make install

我确实看到了新版本:

$ openssl version
OpenSSL 1.1.1l  24 Aug 2021

我确保旧的过期证书已经消失并且新的证书处于活动状态:

# Look for expired LetsEncrypt certificate.
$ openssl x509 -enddate -noout -in /etc/ssl/certs/DST_Root_CA_X3.pem
Can't open /etc/ssl/certs/DST_Root_CA_X3.pem for reading, No such file or directory
140352100943680:error:02001002:system library:fopen:No such file or directory:crypto/bio/bss_file.c:69:fopen('/etc/ssl/certs/DST_Root_CA_X3.pem','r')
140352100943680:error:2006D080:BIO routines:BIO_new_file:no such file:crypto/bio/bss_file.c:76:
unable to load certificate

# Look for new LetsEncrypt ISRG_Root_X1 certificate
$ openssl x509 -enddate -noout -in /etc/ssl/certs/ISRG_Root_X1.pem
notAfter=Jun  4 11:04:38 2035 GMT

我再次重启以确保万无一失。不幸的是,我仍然收到错误。如果我尝试openssl再次下载 1.1.0 版本,将发生以下情况。但是这一次,没有--no-check-certificateswget我之前用来获取文件那样:

$  wget https://www.openssl.org/source/openssl-1.1.0e.tar.gz
--2021-11-24 18:38:38--  https://www.openssl.org/source/openssl-1.1.0e.tar.gz
Resolving www.openssl.org (www.openssl.org)... 2600:1403:5400:59f::c1e, 2600:1403:5400:5b3::c1e, 104.122.65.172
Connecting to www.openssl.org (www.openssl.org)|2600:1403:5400:59f::c1e|:443... connected.
ERROR: cannot verify www.openssl.org's certificate, issued by ‘/C=US/O=Let's Encrypt/CN=R3’:
  Unable to locally verify the issuer's authority.
To connect to www.openssl.org insecurely, use `--no-check-certificate'.

有人知道我该如何解决这个问题吗?

答案1

如果您只想添加一个,则无需下载所有 ca 证书。

只需从以下位置下载 PEM 格式的新 ISRG Root X1 根证书即可Let's Encrypt 的存储库(当然已经确认该链接指向的是真正的 HTTPS 保护的站点)。

重命名文件,使其扩展名成为,.crt并放置在 中/usr/local/share/ca-certificates

最后运行:

sudo update-ca-certificates --fresh

相关内容