Curl: Fix CURL (51) SSL error: no alternative certificate subject name matches

前端 未结 6 1671
失恋的感觉
失恋的感觉 2020-12-13 01:06

I am new to CURL world, coming from Windows + .NET domain.

Trying to access Rest API for basic authentication at http://www.evercam.io/docs/api/v1/authentication.

6条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-13 02:05

    It usually happens when the certificate does not match with the host name.

    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.

    More can be found in here: http://curl.haxx.se/docs/sslcerts.html

提交回复
热议问题