I want to modify each step in the TLS handshake process to test whether my tls server meets the specifications. For example, I want to use JMeter to simulate the first "client_hello" request of TLS, and I can customize the content of the parameters in the TLS protocol in JMeter. For example, I can set the "version" value to "aaabbb", and deliberately fail the negotiation . Any good ideas? handshake process
Asked
Active
Viewed 616 times
1 Answers
0
As per SSL Encryption chapter of JMeter User Manual
The JMeter HTTP samplers are configured to accept all certificates, whether trusted or not, regardless of validity periods, etc. This is to allow the maximum flexibility in testing servers.
Therefore if you need to validate the TLS handshake you will need to manually script the connection logic including low-level transport settings using Apache HttpComponents using JSR223 Sampler and Groovy language
Example code:
def sslContext = org.apache.http.conn.ssl.SSLContexts.custom().useTLS().build()
String [] protocols = ['aaabbb']
def f = new org.apache.http.conn.ssl.SSLConnectionSocketFactory(sslContext, protocols, null, org.apache.http.conn.ssl.SSLConnectionSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER)
def client = org.apache.http.impl.client.HttpClients.custom().setSSLSocketFactory(f).build();
def get = new org.apache.http.client.methods.HttpGet('https://example.com')
client.execute(get)
Demo:

Dmitri T
- 159,985
- 5
- 83
- 133