How do I configure a HostnameVerifier on an HttpsURLConnection?

Dwayne Schultz

The solution:

connection.setHostnameVerifier(new HostnameVerifier()
    public boolean verify(String urlHostname, String certHostname)
        return ("".equalsIgnoreCase(certHostname) &&
Here I'm using a HostnameVerifier (in an anonymous class) to overlook a certificate name mismatch. In this case the vendor '' is using their '' on their '' server.
0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact