title: SSLHandshakeException: no cipher suites in common
body: <p>Followed the instructions <a href="http://docs.oracle.com/javaee/1.4/tutorial//Security6.html" rel="nofollow noreferrer">here</a> and recreated certificates that I previously incorrectly created. Something has changed as I am now seeing <code>javax.net.ssl.SSLHandshakeException: no cipher suites in common</code> on the server and <code>javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure</code> on the client. Instead of the errors <a href="https://stackoverflow.com/q/9547980/666891">this question</a></p>
  
  <p>The server is <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/security/jsse/samples/sockets/server/ClassFileServer.java" rel="nofollow noreferrer">ClassFileServer.java</a> and the respective client <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/security/jsse/samples/sockets/client/SSLSocketClientWithClientAuth.java" rel="nofollow noreferrer">SSLSocketClientWithClientAuth.java</a></p>
  
  <p>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.</p>
  
  <hr>
  
  <p><strong>Update:</strong></p>
  
  <p>Here are the steps I have used to generate the files, I may be confusing the key and truststore.:</p>
  
  <p>On the server (following by <a href="http://docs.oracle.com/javaee/1.4/tutorial/doc/Security6.html#wp148406" rel="nofollow noreferrer">this</a> guide):</p>
  
  <p><code>$ keytool -genkey -alias serverkey -keyalg RSA -keypass p@ssw0rd
   -storepass p@ssw0rd -keystore keystore.jks</code></p>
  
  <p><code>$ keytool -export -alias serverkey -storepass p@ssw0rd -file
   server.cer -keystore keystore.jks</code></p>
  
  <p><code>$ keytool -import -v -trustcacerts -alias clientkey -file
   ../client/client.cer -keystore cacerts.jks -keypass p@ssw0rd
   -storepass p@ssw0rd</code></p>
  
  <p>On the client-side (by <a href="http://docs.oracle.com/javaee/1.4/tutorial/doc/Security6.html" rel="nofollow noreferrer">this</a> guide):</p>
  
  <p><code>$ keytool -genkey -alias clientkey -keyalg RSA -keypass changeit
   -storepass changeit -keystore keystore.jks</code></p>
  
  <p><code>$ keytool -export -alias clientkey -storepass changeit -file
   client.cer -keystore keystore.jks</code></p>
  
  <p><code>$ keytool -import -v -trustcacerts -alias serverkey -file
   ../server/server.cer -keystore cacerts.jks -keypass changeit
   -storepass changeit</code></p>
  
  <p>Had to use another medium as the debugging exceeded the body limit of this site:</p>
  
  <p><strong>Client debug error:</strong> <a href="http://pastebin.com/mHCmEqAk" rel="nofollow noreferrer">http://pastebin.com/mHCmEqAk</a></p>
  
  <p><strong>Server debug error:</strong> <a href="http://pastebin.com/YZbh7H8f" rel="nofollow noreferrer">http://pastebin.com/YZbh7H8f</a></p>