curl https://github.com在证书链中使用自签名证书失败

时间:2018-06-05 14:24:26

标签: ssl curl

执行时:

curl -L https://github.com

我明白了:

   % Total    % Received % Xferd  Average Speed   Time    Time     Time
 Current
                                  Dload  Upload   Total   Spent    Left  Speed   0     0    0     0    0     0      0      0 --:--:-- --:--:--
 --:--:--     0 curl: (60) SSL certificate problem: self signed certificate in certificate chain More details here:
 https://curl.haxx.se/docs/sslcerts.html

 curl failed to verify the legitimacy of the server and therefore could
 not establish a secure connection to it. To learn more about this
 situation and how to fix it, please visit the web page mentioned
 above.

卷曲例如。 https://twitter.com完美无缺,甚至认为卡巴斯基也证实了这一点。我也已经按照此处的建议替换了cacert.pem - why-cant-curl-properly-verify-a-certificate-on-windows

其他:

curl --version

 curl 7.58.0 (x86_64-w64-mingw32) libcurl/7.58.0 OpenSSL/1.0.2n
 (WinSSL) zlib/1.2.11 libidn2/2.0.4 nghttp2/1.29.0 Release-Date:
 2018-01-24 Protocols: dict file ftp ftps gopher http https imap imaps
 ldap ldaps pop3 pop3s rtsp smtp smtps telnet tftp Features: AsynchDNS
 Debug IDN IPv6 Largefile SSPI Kerberos SPNEGO NTLM SSL libz TLS-SRP
 HTTP2 HTTPS-proxy MultiSSL Metalink


curl -L -v https://github.com

* STATE: INIT => CONNECT handle 0x12bf160; line 1392 (connection #-5000)
* Rebuilt URL to: https://github.com/
* Added connection 0. The cache now contains 1 members
* STATE: CONNECT => WAITRESOLVE handle 0x12bf160; line 1428 (connection #0)   % Total    % Received % Xferd  Average Speed   Time 
Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed   0     0    0     0    0     0      0      0 --:--:-- --:--:--
--:--:--     0*   Trying 192.30.253.112...
* TCP_NODELAY set
* STATE: WAITRESOLVE => WAITCONNECT handle 0x12bf160; line 1509 (connection #0)
* Connected to github.com (192.30.253.112) port 443 (#0)
* STATE: WAITCONNECT => SENDPROTOCONNECT handle 0x12bf160; line 1561 (connection #0)
* Marked for [keep alive]: HTTP default
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt   CApath: none
* TLSv1.2 (OUT), TLS header, Certificate Status (22): } [5 bytes data]
* TLSv1.2 (OUT), TLS handshake, Client hello (1): } [512 bytes data]
* STATE: SENDPROTOCONNECT => PROTOCONNECT handle 0x12bf160; line 1575 (connection #0) { [5 bytes data]
* TLSv1.2 (IN), TLS handshake, Server hello (2): { [109 bytes data]
* TLSv1.2 (IN), TLS handshake, Certificate (11): { [1920 bytes data]
* TLSv1.2 (OUT), TLS alert, Server hello (2): } [2 bytes data]
* SSL certificate problem: self signed certificate in certificate chain
* Marked for [closure]: Failed HTTPS connection
* multi_done
* stopped the pause stream!   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
* Closing connection 0
* The cache now contains 0 members
* Expire cleared curl: (60) SSL certificate problem: self signed certificate in certificate chain More details here:
https://curl.haxx.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could
not establish a secure connection to it. To learn more about this
situation and how to fix it, please visit the web page mentioned
above.

0 个答案:

没有答案