Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

HostnameVerifier not being called

843811Nov 23 2003 — edited Jun 15 2004
I have the following code bit:
sslconn = (HttpsURLConnection) url.openConnection();
sslconn.setHostnameVerifier(new HostnameVerifier()
{
   public boolean verify(String hostname, SSLSession session)
   {
      System.out.println("hostname:   " + hostname);
      System.out.println("peer host:  " + session.getPeerHost());
      return true;
   }
   public boolean verify(String hostname, String certHostname)
   {
      System.out.println("hostname:       " + hostname);
      System.out.println("cert hostname:  " + certHostname);
      return true;
   }
});
sslconn.connect();
When this code is run, I get the typical error below and nothing is printed to the console. As you can see, I've been scouring the net for answers to this, and I've included both the old-style and new-style verify() methods, to no avail. I am running J2SE 1.4.1. Thank you in advance.
javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: Certificate chaining error: issuer DN != subject DN
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 13 2004
Added on Nov 23 2003
12 comments
398 views