背景: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了
