<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi all,<div class=""><br class=""></div><div class="">While working on some unit tests in netty I noticed that there may be a bug in the JDK implementation of SSLEngine / SSLSession. If its not a but it is at least surprising I would say.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">So it seems like before the handshake all values that are set on the SSLSession via putValue are shared across SSLEngine instances. Is this by design or a bug ? I could not find anything I the java docs that would tell me this is by design. It only states: "<span style="background-color: rgb(255, 255, 255);" class=""><font color="#353833" face="Arial, Helvetica, sans-serif" class=""><span style="font-size: 12.15999984741211px;" class="">Until the initial handshake has completed, this method returns a session object which reports an invalid cipher suite of “SSL_NULL_WITH_NULL_NULL”. </span></font></span>This does not sound like it will be the same object every time and so it would share the values.</div><div class=""><br class=""></div><div class="">You can find a reproducer which will throw an exception here:</div><div class=""><br class=""></div><div class=""><a href="https://github.com/normanmaurer/jdk_ssl_session_reproducer" class="">https://github.com/normanmaurer/jdk_ssl_session_reproducer</a></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">I did reproduce this with the latest java8 and java11 releases but I am almost sure it also exists in other versions.</div><div class=""><br class=""></div><div class=""><br class=""></div></body></html>