忽略https域名校验不通过Lin
curl
curl 报错:
curl: (51) Unable to communicate securely with peer: requested domain name does not match the server"s certificate.
忽略方法
- 添加临时 域名解析 缓存的方式,保证对外域名可以直接解析到内网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/
- 直接关闭域名校验 —insecure
# 禁止domain校验
curl -v --insecure https://subdomain.example.com/
wget
增加参数:—no-check-certificate
wget "https://subdomain.example.com/goods.json" --no-check-certificate
本文来自云海天,作者:Lin-Grocery,转载请注明原文链接:https://www.cnblogs.com/moniter/p/hu-luehttps-yu-ming-xiao-yan-bu-tong-guo.html
以上是 忽略https域名校验不通过Lin 的全部内容, 来源链接: utcz.com/z/520513.html