2

One of my applications uses socket for making connection for network message handling. It uses https and everything is ok with message handling.

I need to log whatever happens in handshake process for any possible problems in SSL connection handling. Is there any way to do this in java code. Or even Is there any tool to monitor handshaking process.

Development environment is windows server 2003 uses JDK 6.

Mehdi
  • 746
  • 1
  • 10
  • 25
  • 7
    set property `-Djavax.net.debug=ssl:record` or `-Djavax.net.debug=ssl:handshake` or `-Djavax.net.debug=all` example: http://docs.oracle.com/javase/1.5.0/docs/guide/security/jsse/ReadDebug.html – user1516873 Dec 26 '12 at 08:02
  • @user1516873 thank you for your answer. I need to know is there any way to interrupt some of handshake steps such as clientkeyexchange to handle some exceptions that can happen in the process. For example I want to manipulate the ssl handshake timeout and check if it works fine. – Mehdi Dec 26 '12 at 15:13
  • try find source of `javax.net.ssl.SSLServerSocket` or `javax.net.ssl.SSLSocket`, it will help you create your own implementation, or at least better understand what happens when ssl connection established. – user1516873 Dec 27 '12 at 06:44
  • 3
    Finding the source of SSLServerSocket or SSLSocket won't help you create your own implementation (not that you need to) *or* understand what happens during SSL connection establishment either, and if @user1516873 had ever seen the source of either himself he would know that. There is no specific SSL handshake timeout, just the usual Socket read timeout, and it throws a SocketTimeoutException as usual. It really isn't clear what you're trying to do. – user207421 Dec 27 '12 at 17:17
  • One of our customers reported that sometimes ClientKeyExchange isn't sent after ServerHelloDone is received and after that app suspends about 5 minutes. After all I couldn't replicate the problem. Therefore, I want to find an utility or a programmatic solution to manipulate the handshake to replicate that situation to find why the application doesn't do send/receive after that and what happen when it comes back to work. – Mehdi Dec 30 '12 at 10:19
  • What you need is a socket read timeout, not any of this unimplementable speculation. – user207421 Nov 17 '14 at 08:40

0 Answers0