卷曲:修正卷曲(51)SSL错误:没有替代的证书使用者名称匹配 [英] Curl: Fix CURL (51) SSL error: no alternative certificate subject name matches
问题描述
我是CURL世界的新手,来自Windows + .NET域.
I am new to CURL world, coming from Windows + .NET domain.
尝试通过 http://www.evercam.io/docs/api/访问Rest API进行基本身份验证v1/身份验证.
curl -X GET https://api.evercam.io/v1/... \
-u {username}
成功完成CURL设置后,不知道如何在Windows命令提示符下使用此命令.测试了CURL,如下所示:
Don't know how to use this command on windows command prompt after having CURL setup successfully. Tested CURL as follows:
C:\>curl --version
curl 7.33.0 (x86_64-pc-win32) libcurl/7.33.0 OpenSSL/0.9.8y zlib/1.2.8 libssh2/1.4.3
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp scp s
ftp smtp smtps telnet tftp
Features: AsynchDNS GSS-Negotiate Largefile NTLM SSL SSPI libz
现在我以这个结尾
C:\>curl -u myuser:mypassword -X GET https://api.evercam.io/v1/
curl: (51) SSL: no alternative certificate subject name matches target host name 'api.evercam.io'
如何解决此SSL问题51错误?
How can I fix this SSL issue 51 error ?
推荐答案
通常在证书与主机名不匹配时发生.
It usually happens when the certificate does not match with the host name.
解决方案是与主机联系并要求其修复其证书.
否则,您可以使用-k
(或--insecure
)选项关闭cURL的证书验证.
请注意,正如选项所说,这是不安全.您不应该使用此选项,因为它允许中间人攻击并破坏HTTPS的目的.
The solution would be to contact the host and ask it to fix its certificate.
Otherwise you can turn off cURL's verification of the certificate, use the -k
(or --insecure
) option.
Please note that as the option said, it is insecure. You shouldn't use this option because it allows man-in-the-middle attacks and defeats the purpose of HTTPS.
更多信息可以在这里找到: http://curl.haxx.se/docs/sslcerts .html
More can be found in here: http://curl.haxx.se/docs/sslcerts.html
这篇关于卷曲:修正卷曲(51)SSL错误:没有替代的证书使用者名称匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!