忽略https域名校验不通过

curl

curl 报错:

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

  • 忽略方法

    1. 添加临时 域名解析 缓存的方式,保证对外域名可以直接解析到内网IP
     # 手工指定域名DNS解析结果,比如把subdomain.example.com:443解析到10.0.0.100:443
     curl -v --resolve subdomain.example.com:443:10.0.0.100 https://subdomain.example.com/
    
    1. 直接关闭域名校验 —insecure
     # 禁止domain校验
     curl -v --insecure https://subdomain.example.com/
    

wget

增加参数:—no-check-certificate

wget 'https://subdomain.example.com/goods.json' --no-check-certificate
posted @ 2022-05-18 23:44  Lin-Grocery  阅读(212)  评论(0编辑  收藏  举报