3

I try to connect to a wss (Secure Websocket) server with a java applet but the ssl handshake fails without any helpfull log entrys.

If I connect to wss://echo.websocket.org the handshake works fine, so I think it's not a general java code error.

If I try to connect to my own server, the HelloDone bit is sent (verified by wireshark) but the connections ends in a hang-up and it's not in the log. Normally there should be the following message in the log: "*** ServerHelloDone"

See my java console log of "javax.net.debug=sll" http://pastebin.com/ZuvKww4J It is not truncated, it simply ends there. After a couple of seconds the tcp connection timeout message is added to the log.

I use the following example of java code: https://github.com/TooTallNate/Java-WebSocket/blob/master/src/main/example/SSLClientExample.java

But instead of keystore I use:

sslContext.init( null, null, null );

For the server I have two different test systems:

  1. At port 443 a ha-proxy
  2. at port 8443 a stunnel.

I tried to isolate the error with different methods. First I forced with stunnel the same cipher as echo.websocket.org "SSL_RSA_WITH_RC4_128_SHA" but no success.

Second I checked if the ssl certificate itself is still valid. But as web browser and normal https connection by my java applet, are accepted from the server (Same server. ha-proxy orstunnel) everything is working at that point to.

GreenRover
  • 1,486
  • 1
  • 14
  • 33
  • I had such problems recently. I posted a very different question, but you can follow the steps I did and maybe it will help you to find the root-cause: http://stackoverflow.com/questions/15544116/sslhandshakeexception-received-fatal-alert-handshake-failure-when-setting-ciph – Avi Apr 12 '13 at 11:15
  • 4K RSA. Maybe some weird cryptographic restrictions? – user1516873 Apr 12 '13 at 11:37
  • Now i tryed to use an self sign 2048 bit SHA1withRSA cert (excatly the same like echo.websocket.org) but it still not work. I used -keyalg RSA -sigalg SHA1withRSA params. Thanks to Avi and user1516873 – GreenRover Apr 15 '13 at 08:33

1 Answers1

0

Problem was solved by maintainer of Java-WebSocket. Big thans

GreenRover
  • 1,486
  • 1
  • 14
  • 33