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

