javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorExcept

Hello,

trying to connect to a https server I always get this message

main, SEND TLSv1 ALERT: fatal, description = certificate_unknown

main, WRITE: TLSv1 Alert, length = 2

main, called closeSocket()

main, handling exception: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: End user tried to act as a CA

Here is the code I used

publicvoid sendMessage()(

String keyStoreFile ="D:\\SSL_DISKETTE\\von infoconnex ausgestellt\\10cert.p12";

String trustStoreFile ="D:\\SSL_DISKETTE\\truststore";

System.setProperty("javax.net.ssl.trustStore", trustStoreFile);

System.setProperty("javax.net.ssl.trustStorePassword","password");

System.setProperty("javax.net.ssl.keyStoreType","pkcs12");

System.setProperty("javax.net.ssl.keyStore", keyStoreFile);

System.setProperty("javax.net.ssl.keyStorePassword","tjienmar");

try{

int port = 5901;

String hostname ="myurl";

URL url =new URL(hostname);

connection = (javax.net.ssl.HttpsURLConnection) url.openConnection();

connection.connect();

}catch (SSLPeerUnverifiedException e){

System.out.println(" SSL Peer " + e.getMessage());

}catch(SSLHandshakeException e){

System.out.println(" Handshake Exception " + e.getMessage());

}catch (IOException e){

System.out.println(" IO Exception " + e.getMessage());

}

}

Any recommendation will be a great help

Regards

Richard

www.gesis.org

[2405 byte] By [Tjien2003a] at [2007-10-1 1:49:08]
# 1

Hi,

I was facing the same problem. What I tried was setting the properties while running the program.i.e. -javax.net.ssl.trustStore=C:/jdk1.4/jre/lib//filename

. It worked for me. U can also try that. Set all properties on command line and also the protocol to

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

HTH

aditya_26781a at 2007-7-8 8:11:03 > top of Java-index,Security,Java Secure Socket Extension (JSSE)...