PR https://github.com/netty/netty/pull/5321
 Fixed by https://github.com/netty/netty/pull/5321

Please define a static byte[] and reuse everytime. Something like:

private static final byte[] ID = new byte[] {'n', 'e', 't', 't', 'y'};

OpensslEngine throws "session id context uninitialized" when used with client authentication
I use netty to implement a webserver. With JDK ssl provider all work well but with open ssl provider i see the following errors when connection is made from a firefox browser and client authentication (mutual ssl) is requested. Without client authentication the error does not occur.

<pre>
javax.net.ssl.SSLHandshakeException: error:140D9115:SSL routines:ssl_get_prev_session:session id context uninitialized
    at io.netty.handler.ssl.OpenSslEngine.shutdownWithError(OpenSslEngine.java:575)
    at io.netty.handler.ssl.OpenSslEngine.sslReadErrorResult(OpenSslEngine.java:778)
    at io.netty.handler.ssl.OpenSslEngine.unwrap(OpenSslEngine.java:733)
    at io.netty.handler.ssl.OpenSslEngine.unwrap(OpenSslEngine.java:810)
</pre>


When used with chrome i see sometimes also this error

<pre>
error:140A1175:SSL routines:ssl_bytes_to_cipher_list:inappropriate fallback
</pre>


When used with safari i see sometimes also this error

<pre>
error:140760FC:SSL routines:SSL23_GET_CLIENT_HELLO:unknown protocol
</pre>


After a little bit of research this issue look like:
http://openssl.6102.n7.nabble.com/error-140D9115-SSL-routines-SSL-GET-PREV-SESSION-session-id-context-uninitialized-td5749.html
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=729480
https://jira.mongodb.org/browse/SERVER-9307

Netty: 4.0.36 with Fork15 of netty tcnative and OpenSSL 1.0.2e 3 Dec 2015

handler/src/main/java/io/netty/handler/ssl/OpenSslServerContext.java
handler/src/main/java/io/netty/handler/ssl/OpenSslServerContext.java
diff --git a/handler/src/main/java/io/netty/handler/ssl/OpenSslServerContext.java b/handler/src/main/java/io/netty/handler/ssl/OpenSslServerContext.java
index 156843eb63c..f069eaa4927 100644
--- a/handler/src/main/java/io/netty/handler/ssl/OpenSslServerContext.java
+++ b/handler/src/main/java/io/netty/handler/ssl/OpenSslServerContext.java
@@ -36,6 +36,7 @@
  * A server-side {@link SslContext} which uses OpenSSL's SSL/TLS implementation.
  */
 public final class OpenSslServerContext extends OpenSslContext {
+    private static final byte[] ID = new byte[] {'n', 'e', 't', 't', 'y'};
     private final OpenSslServerSessionContext sessionContext;
 
     /**
@@ -439,6 +440,7 @@ void verify(OpenSslEngine engine, X509Certificate[] peerCerts, String auth)
                 }
             }
             sessionContext = new OpenSslServerSessionContext(ctx);
+            sessionContext.setSessionIdContext(ID);
             success = true;
         } finally {
             if (!success) {
