Wget 因证书错误而失败

Wget fails with certificate error

作为自动构建的一部分,我们 运行 从 github 下载一些代码。最小示例:

wget github.com

最近,命令开始失败并出现证书错误:

URL transformed to HTTPS due to an HSTS policy
--2017-10-05 11:43:45--  https://github.com/
Resolving github.com (github.com)... 192.30.253.112, 192.30.253.113
Connecting to github.com (github.com)|192.30.253.112|:443... connected.

ERROR: cannot verify github.com's certificate, issued by 'CN=DigiCert SHA2 Extended Validation Server CA,OU=www.digicert.com,O=DigiCert Inc,C=US':
  Unable to locally verify the issuer's authority.

我尝试更新证书存储和 wget 本身:

update-ca-certificates
apt-get install wget

错误还是一样。 我的wget版本是GNU Wget 1.17.1,OS是Ubuntu16.04.3.

在wget命令行添加--no-check-certificate选项可以避免检查证书的有效性。

答案原来在数据包配置的某个地方。不幸的是,我无法确切地说出原因。怀疑是从 ppa 安装的某些 mono 版本扰乱了我们的证书存储。