作为自动构建的一部分,我们运行从 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,操作系统是Ubuntu 16.04.3。
最佳答案
您可以在 wget 命令行中添加 --no-check-certificate
选项来避免检查证书的有效性。
关于ssl - Wget 因证书错误而失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46582724/