Got an handshake_alert or any other Https related issue with JMeter? It might be linked to Server Name Indication HTTPS extension. design , http , ssl , http , jsr223 https://octoperf.com/blog/2017/12/07/fix-jmeter-sni-issue/ OctoPerf ZI Les Paluds, 276 Avenue du Douard, 13400 Aubagne, France +334 42 84 12 59 contact@octoperf.com Jmeter 233 2023-01-23

Fix JMeter SNI Issue

OctoPerf is JMeter on steroids!
Schedule a Demo

SNI is the acronym for Server Name Indication:

Server Name Indication (SNI) is an extension to the TLS computer networking protocol by which a client indicates which hostname it is attempting to connect to at the start of the handshaking process.

SNI extension may not work with legacy web-servers who doesn’t support it. Fortunately, SNI extension can be disabled in JMeter. JMeter is a Java program. Java has enabled SNI support in Java 7. The issue is typically displayed in JMeter as an SSLHandshakeException, with message like handshake_failure or handshake alert: unrecognized_name.

JMeter uses HTTPClient to perform Http Requests. HttpClient uses the Java JDK SSL support mechanism. Therefore, disabling SNI support in the Java Virtual Machine will disable SNI in HttpClient.

Disable SNI via JSR223

Put a JSR223 Sampler at the beginning of the Thread group, and set the following script:

System.setProperty("jsse.enableSNIExtension", "false");

It must be defined before any HTTP Sampler, otherwise the setting won’t be taken into account. See JSR223 Samples for more sample JSR223 scripts.

As shown in the screenshot above, the script is placed before any HTTP Sampler. It simply sets the system property.

JMeter JSR223 Disable SNI

Disable SNI via JVM Args

Another way is to export JVM_ARGS before executing JMeter:

export JVM_ARGS="-Djsse.enableSNIExtension=false"

Restart JMeter, and it should take into account the JVM setting. Of course, remember to do the same tweak on every load generator in case you run distributed load tests.

Fix JMeter SNI Issue
Tags:
Share:
Comments (2)
  • Thank’s for this article. I do try execute a distributed load tests in non gui mode, but i have the same problem in the slave hosts. Please tell me, how i do the solution number 2 (args JVM). If is possible step by step. I am use windows system and java 8.

    Thanks a lot

    Greettings

    • Hi Orlando,

      On Windows, the command to set environment variables is a little bit different. You must use set variable=value. Make sure to run the command set JVM_ARGS="-Djsse.enableSNIExtension=false" before running any slave JMeter instance.

      Best Regards.

Want to become a super load tester?
OctoPerf Superman