dcsimg
How do I configure a HostnameVerifier on an HttpsU...
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   John_Zukowski
Posted On:   Sunday, February 4, 2001 07:46 PM

How do I configure a HostnameVerifier on an HttpsURLConnection?

Re: How do I configure a HostnameVerifier on an HttpsU...

Posted By:   Dwayne_Schultz  
Posted On:   Friday, July 27, 2001 11:55 AM

I'm not sure how jGuru works. I found this unanswered question while searching google on how to solve this exact problem. Anyway the solution:


connection.setHostnameVerifier(new HostnameVerifier()
{
public boolean verify(String urlHostname, String certHostname)
{
return ("www.badcert.com".equalsIgnoreCase(certHostname) &&
"xyz.badcert.com".equalsIgnoreCase(urlHostname))
}
});



Here I'm using a HostnameVerifier (in an anonymous class) to overlook a certificate name mismatch. In this case the vendor 'badcert.com' is using their 'www.badcert.com' on their 'xyz.badcert.com' server.

Anyone know how to send authentication details on HTTP_UNAUTHORIZED??

About | Sitemap | Contact