SSLLogger.java (was Re: Code Review Request: TLS 1.3 Implementation)

Xuelei Fan xuelei.fan at oracle.com
Mon Jun 11 13:51:40 UTC 2018


Hi Daniel,

It's a good idea.  I added your comment to the TLS 1.3 implementation 
issues tracking enhancement:
    https://bugs.openjdk.java.net/browse/JDK-8204636


Thanks,
Xuelei

On 6/11/2018 2:28 AM, Daniel Fuchs wrote:
> Hi Xuelei,
> 
> Just a note that it might be a better idea to rework
> the implementation of SSLLogger/SSLConsoleLogger a
> bit in order to have SSLLogger implement System.Logger.
> This would  ensure that the SSLLogger class is skipped
> when looking for the caller, when the underlying logger
> is a logger returned by System.getogger() and the backend
> is java.util.logging. Otherwise the caller will appear
> to be the static methods defined on the SSLLogger class
> itself.
> 
> best regards,
> 
> -- daniel
> 
> 
> On 10/06/2018 21:41, Xuelei Fan wrote:
>> Update: http://hg.openjdk.java.net/jdk/sandbox/rev/e4fe7c97b1de
>>
>> On 6/9/2018 2:42 AM, Seán Coffey wrote:
>>> Some comments on SSLLogger also :
>>>
>>> formatCaller() uses getStackTrace() to walk the stack. It's probably 
>>> more expensive than using the newer Stackwalker class. Could it be 
>>> replaced with something like :
>>>
>>>>          return StackWalker.getInstance().walk(s ->
>>>>                  s.dropWhile((f -> 
>>>> f.getClassName().startsWith("sun.security.ssl.SSLLogger")))
>>>>                          .map(f -> f.getClassName() + ":" + 
>>>> f.getLineNumber())
>>>>                          .findFirst().orElse("unknown caller"));
>>>
>> Good point!



More information about the security-dev mailing list