Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

javax.net.ssl.SSLHandshakeException: null cert chain

843811Apr 14 2009
Hi,

I've been trying to run a simlple client-server ssl sockets program (taken from http://www.uni-ulm.de/admin/doku/jdk1.5/docs/guide/security/jsse/JSSERefGuide.html#SampleCode : ClassFileServer & SSLSocketClientWithClientAuth), with no success:

Server: java -cp 3.7test.jar -Djavax.net.debug=ssl ssl.ClassFileServer 8077 . TLS true
Client: java -cp 3.7test.jar -Djavax.net.debug=ssl ssl.SSLSocketClientWithClientAuth localhost 8077

I've been receiving the above exception on my server side, while getting the following exception on the client side: javax.net.ssl.SSLHandshakeException: Received fatal alert: bad_certificate

I've created a self-signed certifcate, keystore and truststore using the keytool application:

keytool -genkey -keystore .keystore -keyalg RSA -alias xmlrpcKey -storepass password1 -keypass password1
keytool -export -keystore .keystore -alias xmlrpcKey -storepass password1 -file xmlrpc.cer
keytool -import -keystore .truststore -alias xmlrpcKey -file xmlrpc.cer -storepass password1

I've been running both client and server on the same machine (Sun Solaris 10) using jdk 1.6.0_12, so I dont think its a firewall issue as I read on different posts.

If needed, I can attach source code, certificate, keystore, truststore & ssl debug outpout.

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 12 2009
Added on Apr 14 2009
0 comments
257 views