I am trying to connect to a REST webservice using HTTPClient / URLConnection. Its a simple code that works fine in jdk 1.7 but throws a SSLHandshake Exception while using jdk1.6
IO Exception: javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No subject alternative DNS name matching your.domain.name.com found.
...
Caused by: java.security.cert.CertificateException: No subject alternative DNS name matching your.domain.name.com found.
Also, the code is very basic
URL url = new URL("https://your.domain.name.com/services/");
HttpsURLConnection urlConnection = (HttpsURLConnection) url.openConnection();
urlConnection.setRequestProperty("Authorization", "Basic " + encodedCredenials);
urlConnection.setRequestProperty("Content-Type", "application/vnd.mtdomain.gold+json");
InputStream is = urlConnection.getInputStream();
Is this a known issue between jdk 1.6 and 1.7 ? How can we get this fixed ? I am not much fluent with SSL related issues.