在Windows的HTTPS URL上运行wget时,如何解决证书错误?

Jon*_*der 1 windows ssl wget

我正在尝试使用Windows的Wget从特定的URL下载文档。

当我这样做时,对于许多(但不是全部)网站,我会收到证书错误。例如:

C:\temp> wget https://stackoverflow.com/
Run Code Online (Sandbox Code Playgroud)

产生:

--2017-07-07 15:54:40--  https://stackoverflow.com/
Resolving stackoverflow.com (stackoverflow.com)... 151.101.193.69, 151.101.129.69, 151.101.1.69, ...
Connecting to stackoverflow.com (stackoverflow.com)|151.101.193.69|:443... connected.
ERROR: cannot verify stackoverflow.com's certificate, issued by 'CN=DigiCert SHA2 High Assurance Server CA,OU=www.digicert.com,O=DigiCert Inc,C=US':
  Unable to locally verify the issuer's authority.
To connect to stackoverflow.com insecurely, use `--no-check-certificate'.
Run Code Online (Sandbox Code Playgroud)

如错误消息所示,我可以通过在--no-check-certificate命令中包含参数来解决此问题。但是,我想避免这种情况,因为这(1)不安全,并且(2)麻烦。

如您所料,使用此PC上的任何Web浏览器(Firefox,Chrome,Edge,IE,Vivaldi),我都可以毫无问题地连接到https://stackoverflow.com/(以及其他受影响的URL)。

我没有运行Cygwin(因此,对类似问题的答案不适用)。

有没有一种方法可以将Windows的Wget配置为使用我的操作系统和/或浏览器使用的同一组根证书,从而不会产生“无法在本地验证发行者的权限”错误?

Jon*_*der 5

我一直在使用的Windows Wget版本(wget.exe)来自http://gnuwin32.sourceforge.net/packages/wget.htm,版本号为1.11.4,日期为2008-12-31。

我只是将其替换为https://eternallybored.org/misc/wget/中的更高版本,版本号为1.19.1,并提到了“ Windows证书存储支持”。

使用该较新的版本,我不再收到Unable to locally verify the issuer's authority错误,并且下载似乎可以安全,正常地工作。