title: Java JSSE SSLEngine cannot resume SSL session
body: <p>I am writing an application that uses SSLEngine with NIO, I writing both the client and the server.
  The client is able to connect to the server and after he is connected i want him to be able to perform session resumption / renegotiation, but currently without luck..</p>
  
  <p>As the code that uses the SSLEngine is pretty big (SSLEngine usage is SO complex!) i will write a simple pseudo code that demonstrate the situation:</p>
  
  <pre><code>Server:
      global sslcontext initialized once
      await new client
      client.sslEngine = create new server ssl engine using the global sslcontext
      client.handleHandshake and wait for it to be done
      handle client.
  
  Client:
      global sslcontext initialized once
      sslEngine = create new client ssl engine using the global sslcontext
      performHandshake and wait for it to be done
      disconnect (close gracefully the connection)
      sslEngine = create new client ssl engine using the global sslcontext
      configure engine to not allow session creation
      performHandshake and wait for it to be done
  </code></pre>
  
  <p>** i am more then willing to post any part of the code that can help (even the full code although as i said it is huge..)</p>
  
  <p>when i executing my program the first connection is successful but the second cause an exception:</p>
  
  <pre><code>javax.net.ssl.SSLHandshakeException: No existing session to resume
  </code></pre>
  
  <p>did i miss some ingredient that is required for ssl session resumption?</p>