Default hostnameverifier always returns false ...

Hi,

I am trying to run wsdl2java by supplying an https URL. The JVM args that I am using are:

javax.net.ssl.trustStore=E:/Romil/projects/AirDeccanPlugin/localhost.ks

java.protocol.handler.pkgs=com.sun.net.ssl.internal.www.protocol

On running wsdl2java, I end up getting the following exception:

java.io.IOException: wrong hostname : should be <...>

I've verified that the hostname (IP address) in the URL exactly matches the CN (IP address) in the server certificate .

When I look at the JSSE code, it seems like the default HostnameVerifier always returns "false".

I also couldnt figure out a non-programatical way of supplying my own

HostnameVerfier to JSSE that returns a "true"

Any solutions/thoughts ?

Thanks and regards,

Romil

[820 byte] By [romiljainromila] at [2007-10-1 19:18:05]
# 1
Hi Romil.Did you find solution for this issue?I am also facing the problem.if you got the solution, please respond me ASAP.Thanks,Deepa.
deeps123a at 2007-7-11 15:21:25 > top of Java-index,Security,Java Secure Socket Extension (JSSE)...
# 2

try this code before creating a connection

com.sun.net.ssl.HostnameVerifier hv=new com.sun.net.ssl.HostnameVerifier() {

public boolean verify(String urlHostname, String certHostname) {

System.out.println("Warning: Hostname is not matched for cert: "+urlHostname+ certHostname);

return true;

}

};

com.sun.net.ssl.HttpsURLConnection.setDefaultHostnameVerifier(hv);

this should solve your problem

cheers

dnyaneea at 2007-7-11 15:21:25 > top of Java-index,Security,Java Secure Socket Extension (JSSE)...