curl: (51) Unable to communicate securely with peer: requested domain name does not match the server's certificate.报错

[root@localhost ~]# curl https://pre.bjy****.com/wec****-server/
curl: (51) Unable to communicate securely with peer: requested domain name does not match the server’s certificate.

curl https 网站 出现报错 

解决办法:

You can use the domain name as usual but override the resolver like so:

curl -v --resolve subdomain.example.com:443:x.x.x.x https://subdomain.example.com/ 

It might be awkward to maintain a lot of such mappings though. You might prefer to just ignore the cert mismatch:

curl --insecure https://subdomain.example.com/
    原文作者:weifengCorp
    原文地址: https://www.cnblogs.com/weifeng1463/p/8582921.html
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞