Followed the instructions here and recreated certificates that I previously incorrectly created. Something has changed as I am now seeing 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 the errors this question
The server is ClassFileServer.java and the respective client SSLSocketClientWithClientAuth.java
Any tips on getting the two ends to play nicely, note that I am using localhost so I would assume the cipher capabilities are the same.
Update:
Here are the steps I have used to generate the files, I may be confusing the key and truststore.:
On the server (following by 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 (by 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
Had to use another medium as the debugging exceeded the body limit of this site:
Client debug error: http://pastebin.com/mHCmEqAk
Server debug error: http://pastebin.com/YZbh7H8f
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…