SSLKeyException: RSA premaster secret error when running from comand line
948199Jul 9 2012 — edited Jul 11 2012Welcome,
I'm writing https client using apache htclient library 4.1. I have self signed certificate.
It runs corect form my ide - STS Spring Tool Suite, but when run from command line(in bat file)
call C:\Java\jdk\jdk1.6.0_32x64\bin\java -Djavax.net.debug=all -Dcom.sun.management.jmxremote -Djavax.net.ssl.trustStore=jssecacerts -Djavax.net.ssl.trustStorePassword=changeit -Djava.ext.dirs=../lib com.myapp.Main
I get:
pool-1-thread-2, handling exception: javax.net.ssl.SSLKeyException: RSA premaster secret error
pool-1-thread-2, SEND TLSv1 ALERT: fatal, description = unexpected_message
pool-1-thread-2, WRITE: TLSv1 Alert, length = 2
[Raw write]: length = 7
0000: 15 03 01 00 02 02 0A .......
pool-1-thread-2, called closeSocket()
pool-1-thread-2, IOException in getSession(): javax.net.ssl.SSLKeyException: RSA premaster secret error
pool-1-thread-2, called close()
pool-1-thread-2, called closeInternal(true)
2012-07-09 14:09:53,053 pool-1-thread-2 [ERROR] - pool-1-thread-2 org.apache.commons.logging.Log -
javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
at com.sun.net.ssl.internal.ssl.SSLSessionImpl.getPeerCertificates(SSLSessionImpl.java:352)
at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:128)
...
Why it's working in sts?
I put jars from http://www.oracle.com/technetwork/java/javase/downloads/jce-6-download-429243.html to jre folder.
I added certificate to trust store.
I am working on Windows7 64
Any help appreciated
Regards