• Register
0 votes

Problem : 

I have a Java web service client, which consumes a web service via HTTPS.
When I connect to the service URL, I get the exception 
java.security.cert.CertificateException: No subject alternative names present.
by (6.9k points)  

1 Answer

0 votes

Solution :

I have also faced the same issue and resolved it with bellow code.One must put this code before the first call to webservices.

new javax.net.ssl.HostnameVerifier()
public boolean verify(String hostname,
javax.net.ssl.SSLSession sslSession) 
return hostname.equals("localhost");

Further Readings:


by (36.1k points)  
edited by