No subject alternative names matching IP address xxxxxx found

No subject alternative names matching IP address xxxxxx found_第1张图片

背景:RestTemplate.getForEntity方法 http请求 8443接口(日志里变成https),报错

日志报错:
I/O error on GET request for “https://xxxxxxxxxx”: java.security.cert.CertificateException: No subject alternative names matching IP address xxxxxx found;
nested exception is javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No subject alternative names matching IP address xxxxxx found
采用如下方法解决(可以添加证书或者跳过验证,我采用跳过的方式)
https://blog.csdn.net/flyestcoder/article/details/113242087

再请求报400
RestTemplate将http请求修改为https
再测试就OK了

你可能感兴趣的:(liunx,ssl,https,网络协议)