private RestTemplate restTemplate = new RestTemplate();
private static final HostnameVerifier PROMISCUOUS_VERIFIER = (s, sslSession ) -> true;
privite void test(){
restTemplate.setRequestFactory( new SimpleClientHttpRequestFactory() {
@Override
protected void prepareConnection(HttpURLConnection connection, String httpMethod) throws IOException {
if(connection instanceof HttpsURLConnection){
((HttpsURLConnection) connection).setHostnameVerifier(PROMISCUOUS_VERIFIER);
}
super.prepareConnection(connection, httpMethod);
}
});
//restTemplate.exchange().....
}