title: Open JDK 11 HTTP/2 Handshake ServerHello java.util.NoSuchElementException
body: <p>When testing the Open JDK 11 HTTP client over HTTP/2, there is a server-side error which looks like a JDK 11 bug.</p>
  
  <p>The test runs several threads against a Tomcat 9 server, testing that all threads use HTTP/2 and TLS1.3.  </p>
  
  <p>The concern is that the error is inside the 'sun.security.ssl.SSLHandshake.produce', which means it is not Tomcat, but the JDK causing the error.</p>
  
  <p>Can anyone confirm that you have had the same experience when load testing the HTTP layer of JDK 11?  If so, I will reported to the Open JDK team.</p>
  
  <p>The error is only evident when running a load test:</p>
  
  <pre><code>java.util.NoSuchElementException: No value present
          at java.base/java.util.Optional.get(Optional.java:148) ~[na:na]
          at java.base/sun.security.ssl.ServerHello$T13ServerHelloProducer.produce(ServerHello.java:551) ~[na:na]
          at java.base/sun.security.ssl.SSLHandshake.produce(SSLHandshake.java:436) ~[na:na]
          at java.base/sun.security.ssl.ClientHello$T13ClientHelloConsumer.goServerHello(ClientHello.java:1224) ~[na:na]
          at java.base/sun.security.ssl.ClientHello$T13ClientHelloConsumer.consume(ClientHello.java:1160) ~[na:na]
          at java.base/sun.security.ssl.ClientHello$ClientHelloConsumer.onClientHello(ClientHello.java:849) ~[na:na]
          at java.base/sun.security.ssl.ClientHello$ClientHelloConsumer.consume(ClientHello.java:810) ~[na:na]
          at java.base/sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:392) ~[na:na] ...
  </code></pre>
  
  <p>This <a href="https://github.com/ulrichenslin/jdk11SpringBootIntermittentSslError" rel="noreferrer">github</a> project was used for testing.  See the project readme for more details.</p>