Curl:修复 CURL (51) SSL 错误:没有替代证书主题名称匹配 [英] Curl: Fix CURL (51) SSL error: no alternative certificate subject name matches

查看:125
本文介绍了Curl:修复 CURL (51) SSL 错误:没有替代证书主题名称匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 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.

解决方案是联系主机并要求其修复其证书.
否则,您可以关闭 cURL 对证书的验证,使用 -k(或 --insecure)选项.
请注意,正如选项所说,它不安全.您不应使用此选项,因为它允许中间人攻击并违背 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

这篇关于Curl:修复 CURL (51) SSL 错误:没有替代证书主题名称匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆