Strange Handshake problem

Hallo!

I have the following simple piece of code that simply should connect to my tomcat using SSL. However I always get a strange exception. I run it using the VM Parameter: -Djava.protocol.handler.pkgs=com.sun.net.ssl.internal.www.protocol

. The really strange thing is, that when I test it against a random SSL page on the web it works. For example using https://e-campus.uibk.ac.at I don't get an exception... any idea what I could have messed up?

The code:

public

class Test

{

public

static

void

main(String [] arstring)

{

try

{

new java.net.URL("https://localhost:8443/").getContent();

}

catch (Exception exception)

{

exception.printStackTrace();

}

}

}

The Exception:

D:\>java -Djava.protocol.handler.pkgs=com.sun.net.ssl.internal.www.protocol Test

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building f

ailed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certificatio

n path to requested target

at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)

at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(Unknown Source)

[1801 byte] By [charlie.babitt1a] at [2007-11-27 6:36:29]
# 1
You don't need to set that property unless you are running Java 1.3. Don't.If that doesn't help, there are numerous threads in this forum on that exception.
ejpa at 2007-7-12 18:04:10 > top of Java-index,Security,Java Secure Socket Extension (JSSE)...