Thursday, July 12, 2007

java.io.IOException: HTTPS hostname wrong: should be

java.io.IOException: HTTPS hostname wrong: should be

This error occurs when you are trying to access a HTTPS url. You might have already installed the server certificate to your JRE's keystore. But this error means that the name of the server certificate does not match with the actual domain name of the server that is mentioned in the URL. This normally happens when you are using a non CA issued certificate.

But of course you can overcome this problem by instructing the JRE to trust all certificates and to ignore the mis match in the domain name and the certificate issuer. Here is the snippet of code that can be used to achieve this.

0 Comments:

Post a Comment

<< Home