JMeter 5.3 with Http2 plugin 1.6: SSL handshake exception

396 views
Skip to first unread message

Sean

unread,
Oct 16, 2020, 8:43:03 AM10/16/20
to jmeter-plugins
Hi,

I am using the HTTP2 request sampler to send a HTTPs request to a server. The HTTP sampler is always failed because on open connect an SSL handshake exception occurs.

I see other people with similar issue but I have not found a solution.

This my setup:
* JMeter 5.3
* OpenJDK Runtime Environment (build 1.8.0_265-b01)
* alpn-boot-8.1.12.v20180117 added Xbootclasspath using JVM_ARGS 

I am communicating with a server that supports TLSv1.2, TLSv1.1, and TLSv1.3.

HTTP response is:
Non HTTP response message: org.eclipse.jetty.io.RuntimeIOException: javax.net.ssl.SSLHandshakeException: nullSession

HTTP response call stack from jmeter logs:
2020-10-16 08:41:44,798 INFO o.a.j.t.JMeterThread: Thread started: Thread Group 1-1
2020-10-16 08:41:44,819 WARN o.e.j.i.SelectorManager: Exception while notifying connection SslConnection@183a2285::SocketChannelEndPoint@494afcc8{visiopt.com/144.217.229.98:443<->/192.168.0.24:59473,CLOSED,fill=-,flush=-,to=1/30000}{io=1/1,kio=-1,kro=-1}->SslConnection@183a2285{NEED_UNWRAP,eio=-1/-1,di=-1,fill=IDLE,flush=IDLE}~>DecryptedEndPoint@29687f87{visiopt.com/144.217.229.98:443<->/192.168.0.24:59473,CLOSED,fill=-,flush=-,to=1/30000}=>ALPNClientConnection@31f2ff7b
org.eclipse.jetty.io.RuntimeIOException: javax.net.ssl.SSLHandshakeException: nullSession
at org.eclipse.jetty.io.NegotiatingClientConnection.onOpen(NegotiatingClientConnection.java:72) ~[jetty-io-9.4.26.v20200117.jar:9.4.26.v20200117]
at org.eclipse.jetty.io.ssl.SslConnection.onOpen(SslConnection.java:360) ~[jetty-io-9.4.26.v20200117.jar:9.4.26.v20200117]
at org.eclipse.jetty.io.SelectorManager.connectionOpened(SelectorManager.java:324) [jetty-io-9.4.26.v20200117.jar:9.4.26.v20200117]
at org.eclipse.jetty.io.ManagedSelector.createEndPoint(ManagedSelector.java:276) [jetty-io-9.4.26.v20200117.jar:9.4.26.v20200117]
at org.eclipse.jetty.io.ManagedSelector.access$1800(ManagedSelector.java:62) [jetty-io-9.4.26.v20200117.jar:9.4.26.v20200117]
at org.eclipse.jetty.io.ManagedSelector$CreateEndPoint.run(ManagedSelector.java:933) [jetty-io-9.4.26.v20200117.jar:9.4.26.v20200117]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:806) [jetty-util-9.4.26.v20200117.jar:9.4.26.v20200117]
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:938) [jetty-util-9.4.26.v20200117.jar:9.4.26.v20200117]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_265]
Caused by: javax.net.ssl.SSLHandshakeException: nullSession
at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.handshakeFailed(SslConnection.java:933) ~[jetty-io-9.4.26.v20200117.jar:9.4.26.v20200117]
at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.flush(SslConnection.java:1142) ~[jetty-io-9.4.26.v20200117.jar:9.4.26.v20200117]
at org.eclipse.jetty.io.NegotiatingClientConnection.onOpen(NegotiatingClientConnection.java:63) ~[jetty-io-9.4.26.v20200117.jar:9.4.26.v20200117]
... 8 more
Caused by: java.lang.NoSuchFieldError: nullSession
at sun.security.ssl.ClientHandshaker.getKickstartMessage(ClientHandshaker.java:1343) ~[?:1.8.0_265]
at sun.security.ssl.Handshaker.kickstart(Handshaker.java:1117) ~[?:1.8.0_265]
at sun.security.ssl.SSLEngineImpl.kickstartHandshake(SSLEngineImpl.java:736) ~[?:1.8.0_265]
at sun.security.ssl.SSLEngineImpl.writeAppRecord(SSLEngineImpl.java:1232) ~[?:1.8.0_265]
at sun.security.ssl.SSLEngineImpl.wrap(SSLEngineImpl.java:1185) ~[?:1.8.0_265]
at javax.net.ssl.SSLEngine.wrap(SSLEngine.java:511) ~[?:1.8.0_265]
at org.eclipse.jetty.io.ssl.SslConnection.wrap(SslConnection.java:412) ~[jetty-io-9.4.26.v20200117.jar:9.4.26.v20200117]
at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.flush(SslConnection.java:1052) ~[jetty-io-9.4.26.v20200117.jar:9.4.26.v20200117]
at org.eclipse.jetty.io.NegotiatingClientConnection.onOpen(NegotiatingClientConnection.java:63) ~[jetty-io-9.4.26.v20200117.jar:9.4.26.v20200117]
... 8 more
2020-10-16 08:41:44,820 WARN o.e.j.i.ManagedSelector: org.eclipse.jetty.io.RuntimeIOException: javax.net.ssl.SSLHandshakeException: nullSession



If anyone can help me, I am online and ready to debug and fix this.

Thanks

Sean

Sean

unread,
Oct 23, 2020, 12:52:59 AM10/23/20
to jmeter-plugins
Do I need to change my jetty version to fix this NoSuchFieldError: nullSession?

Sean

unread,
Oct 23, 2020, 3:06:44 AM10/23/20
to jmeter-plugins
Well I managed to figure out a solution to the exception I was getting. Finally, it feels good. 

The http2 plugin comes built on jetty 9.4.26. I changed the version to jetty 9.4.28. (Explanation of the need to make this change is described in this link here https://stackoverflow.com/questions/62714281/http-2-request-with-jmeter-fails-with-nullsession-jetty-alpn/63149583#63149583). 

By so doing, we get rid of the dependency on alpn-boot. But this needs to be replaced by jetty-alpn-java-client 9.4.28. And because of this new jar, we need to boost up to OpenJDK 9. The http2 readme says it will only work with OpenJDK 8.

So in the end the following files were added to the jmeter lib folder (and their 9.4.26 counterparts deleted):

jetty-alpn-client-9.4.28.v20200408.jar
jetty-alpn-openjdk8-client-9.4.28.v20200408.jar
jetty-client-9.4.28.v20200408.jar lib
jetty-http-9.4.28.v20200408.jar lib
jetty-io-9.4.28.v20200408.jar lib
jetty-util-9.4.28.v20200408.jar  
Reply all
Reply to author
Forward
0 new messages