Wget 和 Curl 停止使用 HTTPS。错误地抱怨证书过期

Wget and Curl stopped working with HTTPS. Wrongly complain about an expired certificate

我有一个脚本,每天在 Ubuntu 14.04 服务器上 运行s。该脚本是一个简单的 wget 命令,可从远程服务器下载文件并将其保存到本地文件系统:

wget https://example.com/resources/scripts/myfile.php -O myfile.php

几个月来它一直运行良好,直到今天早上突然 运行 我得到:

--2020-05-30 11:57:16--  https://example.com/resources/scripts/myfile.php
Resolving example.com (example.com)... xx.xx.xx.xx
Connecting to example.com (example.com)|xx.xx.xx.xx|:443... connected.
ERROR: cannot verify example.com's certificate, issued by ‘/C=GB/ST=Greater Manchester/L=Salford/O=Sectigo Limited/CN=Sectigo RSA Domain Validation Secure Server CA’:
  Issued certificate has expired.
To connect to example.com insecurely, use `--no-check-certificate'.

域的 SSL 有效并于 2022 年 1 月到期。这方面没有任何变化。然而不知何故 wget 不再看到它。

这是另一个有趣的事实。如果我 运行 在 Ubuntu 18 框上执行完全相同的命令,它就像一个魅力,没有任何抱怨。这告诉我我的 Ubuntu 14.04 机器有问题。

Curl 产生同样的错误:

curl https://example.com
curl: (60) SSL certificate problem: certificate has expired

This post 提示证书包已过期。我已经下载了建议的 PEM 文件,并通过指定 --ca-certificate=cacert.pem 选项尝试 运行ning wget,但无济于事。

我也试过 运行ning: apt install ca-certificatesupdate-ca-certificates,但也没用。

同样,在 Ubuntu 18 盒子上,一切都很好,但在 Ubuntu 14 或 16 盒子上却不行。还有,为什么直到今天早上我知道没有人碰过盒子时它才工作正常?显然有些东西已经过时了,但我似乎无法弄清楚如何修复它。

有人有什么建议吗?

我两天前在使用 Comodo 证书和 ubuntu 16.04 时遇到了同样的错误。 问题就像说 mrmuggles 这个 https://support.sectigo.com/Com_KnowledgeDetailPage?Id=kA03l00000117LT.

我通过以下步骤修复:

  • vi /etc/ca-certificates.conf
  • 删除行(或注释) 指定 AddTrust_External_Root.crt
  • apt 更新 && apt 安装 ca 证书
  • update-ca-certificates -f -v

https://askubuntu.com/questions/440580/how-does-one-remove-a-certificate-authoritys-certificate-from-a-system

与原发布者一样,编辑 ca-certificates.conf 的方法在 Ubuntu 14.04 上对我不起作用。 什么起作用了:

  1. 运行 sudo dpkg-reconfigure ca-certificates

  2. 取消选择问题CA:AddTrust_External_Root

  3. 按确定

我的理解是删除AddTrust_External_Root的过期CA,改用较新的CAUSERTrust_RSA_Certification_Authority