Wget,自签名证书和 --no-check-certificate 不起作用

Min*_*r G 5 linux ssl centos openssl wget

我最近在我们的一个 nginx 网络服务器上安装了一个自签名 SSL 证书。如果我尝试 wget 一个文件,--no-check-certificate我会收到以下错误。您可以使用浏览器访问该站点,浏览器会识别出它是自签名的,并且证书会显示所有正确的信息。似乎基于我应该找到一种方法在本地信任证书的消息,但这不会破坏--no-check-certificate的目的吗?

$ wget https://www.example.com/index.html --no-check-certificate
--2015-02-20 14:13:58--  https://www.example.com/index.html
Resolving example.com... 192.0.2.1
Connecting to example.com|192.0.2.1|:443... connected.
WARNING: cannot verify example.com’s certificate, issued by “/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO RSA Domain Validation Secure Server CA”:
  Unable to locally verify the issuer’s authority.
WARNING: no certificate subject alternative name matches
    requested host name “example.com”.
HTTP request sent, awaiting response... Read error (Connection reset by peer) in headers.
Retrying.
Run Code Online (Sandbox Code Playgroud)

任何想法将不胜感激。

sam*_*usz 2

查看wget的错误输出和命令行,这里的问题不是客户端证书验证。服务器计算机似乎拒绝连接。这可能是由于wget未向服务器提供所需的客户端证书(检查您的其他浏览器是否有该证书)、该特定用户代理被拒绝等。

我宁愿检查服务器的日志。