https證書鏈不完整


公司的一個域名,用瀏覽器打開能正常訪問,但是在linux下使用curl命令,總是報錯,報錯信息如下:

curl: (60) Peer certificate cannot be authenticated with known CA certificates
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option.

  網上搜了下這個報錯信息,花了一天的時間居然還是沒能解決。 

  

后來偶然搜索ssl,打開了一個ssl檢測網站(能檢測https證書是否正常的一個網站),放上鏈接:https://myssl.com/   檢測后發現公司的這個域名https證書有問題:好像是"證書鏈不完整"之類的信息.

於是乎接着百度,google搜索證書鏈不完整的相關結果,終於發現了解決方法。

用另外一個網站生產中間證書: https://www.myssl.cn/tools/downloadchain.html(該網站可以在線生產中間證書)

生產中間證書之后,把中間證書的內容完完全全的復制並追加到crt/cer文件后面(不要有空格,空行)

之后重載nginx配置文件,發現curl 命令不再報錯,至此,問題應該得到了解決,只是還不清楚其中的所以然,有時間了再研究吧。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM