title: Why do I get a handshake failure (Java SSL)
body: <p>I'm connecting to a web service over HTTPS. I've done all that I think is required to make it work, but in the end I get a handshake failure.</p>
  
  <p>I found out that as a new user I can't post more than 2 links due to "spam protection" - thanx a lot stackoverflow...anyway here's a link to a pastebin post with all the links spelled out...so when I write "link#1" here it's a reference to these links: <a href="http://pastebin.com/y4zGNRC7" rel="noreferrer">http://pastebin.com/y4zGNRC7</a></p>
  
  <ul>
  <li>I verified the same behavior using HttpClient (GET on the service URL) and actually calling the web service via a CXF proxy</li>
  <li>I'm setting both the keystore and truststore - I tried both the "in code" way ( link#1 ) and setting the system properties - i.e. System.setProperty("javax.net.ssl.keyStore", "mykeystore.jks");</li>
  <li>SSL debug is on ( javax.net.debug=all )</li>
  <li>SSL debug blurts out the contents of both keystore and truststore (i.e. looks like java "knows about them") - link#2</li>
  <li>seems like there's some client-server communication going on, but then it crashes for some reason link#3</li>
  <li>I successfully connected to the server using the client and CA certificates both in a browser (Chrome) and using openssl s_client</li>
  <li>wireshark shows less client-server talk from java ( link#4 ) then for example from Chrome ( link#5 )</li>
  </ul>
  
  <p><strong>Another strange thing is, that I seem to be getting the same behavior when I set the keystore and when I don't (the only difference is that when I do the keystore contents get printed in the console, but that's it).</strong></p>
  
  <p>I tried googling the problem and I saw numerous similar posts here on stackoverflow, but nothing helped.
  I tried changing the protocol version ("TLSv1", "SSLv3", even the weird v2 Hello).
  Any help would be appreciated - maybe there's some fundamental thing I might have overlooked...I'm getting desperate here...
  Thanx</p>
  
  <p>PS I'm running java 1.6 update 30 on Fedora Core 15 (64bit)</p>