Programming Tutorials

Comment on Tutorial - java.io.IOException: HTTPS hostname wrong: should be By Ramlak



Comment Added by : java

Comment Added at : 2012-08-22 09:39:57

Comment on Tutorial : java.io.IOException: HTTPS hostname wrong: should be By Ramlak
had the sample problem.. java.io.IOException: HTTPS hostname wrong: should be <server_ip>
Used following code as specified in the post .. & it worked

HostnameVerifier hv = new HostnameVerifier() {
public boolean verify(String urlHostName, SSLSession session) {
System.out.println("Warning: URL Host: " + urlHostName
+ " vs. " + session.getPeerHost());
return true;
}
};
HttpsURLConnection.setDefaultHostnameVerifier(hv);

Thanks.


View Tutorial