Follow the instructions here and the newly created certificates that I previously incorrectly created. Something has changed since now I see javax.net.ssl.SSLHandshakeException: no cipher suites in common
on the server and javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
on the client. Instead of errors this question
ClassFileServer.java server and associated SSLSocketClientWithClientAuth.java client
Any advice on making both ends play well, please note that I use localhost, so I assume the encryption options are the same.
Update:
Here are the steps that I used to create the files, I can mislead the key and truststore .:
On the server (following this guide):
$ keytool -genkey -alias serverkey -keyalg RSA -keypass p@ssw0rd -storepass p@ssw0rd -keystore keystore.jks
$ keytool -export -alias serverkey -storepass p@ssw0rd -file server.cer -keystore keystore.jks
$ keytool -import -v -trustcacerts -alias clientkey -file ../client/client.cer -keystore cacerts.jks -keypass p@ssw0rd -storepass p@ssw0rd
On the client side ( this guide):
$ keytool -genkey -alias clientkey -keyalg RSA -keypass changeit -storepass changeit -keystore keystore.jks
$ keytool -export -alias clientkey -storepass changeit -file client.cer -keystore keystore.jks
$ keytool -import -v -trustcacerts -alias serverkey -file ../server/server.cer -keystore cacerts.jks -keypass changeit -storepass changeit
I had to use another medium, because debugging exceeded the limits of the body of this site:
Client debugging error: http://pastebin.com/mHCmEqAk
Server debugging error: http://pastebin.com/YZbh7H8f