
我最近在我們的一台 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.
任何想法將不勝感激。
答案1
看著獲取的錯誤輸出和命令列,這裡的問題不是客戶端證書驗證。伺服器電腦似乎拒絕連線。這可能是由於獲取沒有向伺服器提供所需的用戶端憑證(檢查您的其他瀏覽器是否有該憑證),該特定的使用者代理程式被拒絕等。
我寧願檢查伺服器的日誌。
答案2
您可以嘗試添加一些調試: -S 和 -d 用於伺服器和客戶端標頭。
tcpdump 更好,可以提供完整的故事,但其次是沒有完整資料包有效負載的標頭。