JDK-7013776 : Multithreaded JSSE application debug information is hard to read
  • Type: Enhancement
  • Component: security-libs
  • Sub-Component: javax.net.ssl
  • Affected Version: 7
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2011-01-21
  • Updated: 2021-08-03
  • Resolved: 2020-06-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8u261 b05Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
After dealing with several recent multi-threaded JSSE escalations, we should really rework our debug output to be clearer what is being output, and when.  Currently we just call System.out repeatedly.  This has at least two issues:

1)  It's hard to know which thread is calling.
2)  Many related calls to System.out.println can interleaved.  We should consider creating a large StringBuffer, then outputing that all at once.

For example:

        if (debug != null && Debug.isOn("verbose")) {
            s.print("RandomCookie:  ");
            clnt_random.print(s);

            s.print("Session ID:  ");
            s.println(sessionId);

            s.println("Cipher Suites: " + cipherSuites);

            Debug.println(s, "Compression Methods", compression_methods);
            extensions.print(s);
            s.println("***");

This will take a fair amount of work, but will definitely help in the debugging.
Also, it would be good for binary data to be output as hex numbers instead of signed decimals.  This will make it easier to match up tcpdump/snoop data fields.

Comments
The debug logging was improved in JDK-8196584.
28-06-2018

This improvement would help debug a lot. Nice to consider it in JDK 9.
03-12-2014

We should confirm that the following will be captured : * Time stamps for each print out (I guess the Logger API handles that now) * The session-ID for the SSL operation just printed (if session is established) * Some means to distinguish different socket operations from each other. i.e. identify the peer socket (who are we connected to)
10-11-2014

EVALUATION java.util.logging will not hurt the performance when turnning logging off, may switch to use java.util.logging for JSSE debugging.
24-08-2011

EVALUATION We need to make the improvement. We may want to re-think about new debug output method, such as java.util.logging. We may address the RFE in JDK 8.
21-01-2011