【发布时间】:2018-06-07 14:04:04
【问题描述】:
我运行了一个 curl 查询:curl https://login:password@mywebsite.com/script/
我有几个 curl 可执行文件,一个是用 cygwin 安装的:
1:
curl 7.59.0 (x86_64-unknown-cygwin) libcurl/7.59.0 OpenSSL/1.0.2o zlib/1.2.11 libidn2/2.0.4 libpsl/0.18.0 (+libidn2/2.0.2) libssh2/1.7.0 nghttp2/1.31.0
Release-Date: 2018-03-14
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS Debug IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP HTTP2 UnixSockets HTTPS-proxy PSL Metalink
我编译的另外两个:
2 - libcurl-vc14-x86-release-static-ipv6-sspi-winssl:
curl 7.60.0 (i386-pc-win32) libcurl/7.60.0 OpenSSL/1.0.2k WinIDN
Release-Date: 2018-05-16
Protocols: dict file ftp ftps gopher http https imap imaps ldap pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile SSPI Kerberos SPNEGO NTLM SSL HTTPS-proxy
3 - libcurl-vc14-x86-release-static-ssl-static-ipv6-sspi:
curl 7.60.0 (i386-pc-win32) libcurl/7.60.0 WinSSL WinIDN
Release-Date: 2018-05-16
Protocols: dict file ftp ftps gopher http https imap imaps ldap pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile SSPI Kerberos SPNEGO NTLM SSL
1+3可以做这个'TSL请求',2返回错误信息:
curl: (60) SSL certificate problem: unable to get local issuer certificate
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.
我在这个问题上找到的所有建议是 - 你必须从服务器获取证书文件并将其存储到本地存储中(或告诉 curl 忽略错误)。
我的问题是 - 为什么这是一个建议的答案,而 1 + 3 可以在没有它的情况下做到这一点?有什么不同? 1 + 3 有什么共同点,他们可以做 2 做不到的事情?
【问题讨论】: