If I do not replace the CN by default and use the default CN,It would prompt the shown logs
HttpGet httpget = new HttpGet("https://14.21.6.24:8243/1.0/test/IBM");
logger.info("url=="+httpget.getURI());
httpget.addHeader("content-type", "application/json");
httpget.addHeader("Authorization"," Bearer 8bd14609-17cc-3bb7-99ed-9d8f52f8cef1");
logger.debug("executing request " + httpget.getURI());
// 执行get请求.
logger.info("3");
CloseableHttpResponse response = httpclient.execute(httpget);
javax.net.ssl.SSLException: hostname in certificate didn't match: <14.21.6.24> != <localhost>
at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:231)
at org.apache.http.conn.ssl.BrowserCompatHostnameVerifier.verify(BrowserCompatHostnameVerifier.java:54)