apache jmeter for setting up certificates for massl connection - jmeter

I am new to Jmeter. I wanted to setup jmeter to stress test my server (tomcat) serving APIs. As part of which my backend server is MASSL enabled and hence i need to configure the same in jmeter. I have .cert and .key files (with a pass phrase) which I configure in postman to trigger the API endpoints.
How to setup these certificate configurations in Jmeter?.

You need to convert these certificates into something JMeter can understand (a .jks or .p12 Java Keystore), the conversion can be made using OpenSSL tool or a GUI-based solution like KeyStore Explorer
Once you have the Java Keystore with your certificate(s) you can "tell" JMeter to use this keystore for sending client-side certificates by following JMeter Properties:
javax.net.ssl.keyStore=/path/to/your/keystore
javax.net.ssl.keyStorePassword=your keystore password
javax.net.ssl.keyStoreType= your keystore type (JKS or PKCS12)
the settings need to go into system.properties file or can be passed to JMeter via -D command-line argument like:
jmeter -Djavax.net.ssl.keyStore=/path/to/your/keystore -Djavax.net.ssl.keyStorePassword=your keystore password ....
More information: How to Set Your JMeter Load Test to Use Client Side Certificates

Related

Not able to open Plugin Manager in Apache JMeter 1.6

I have downloaded the Plugin Manager for JMeter from the following link,
https://jmeter-plugins.org/wiki/PluginsManager/
previously it worked fine for me, I never had to do any proxy settings or any changes, but now when I download and try to open it in Jmeter, it gives me the following error:
JMeter version - 5.4.1
It looks like you're behind a corporate proxy which uses MITM certificate to intercept and decrypt secure traffic between your machine and Internet (or other machines in Intranet)
The certificate is not known to Java therefore Plugins Manager cannot securely connect to its repository.
The options are in:
Import the certificate as the trusted certificate and point JMeter to use the truststore containing this certificate via javax.net.ssl.trustStore system property
Configure JMeter Plugins Manager to use HTTP protocol for communicating with the plugins repository, it can be done by adding the next line to user.properties file:
jpgc.repo.address=http://jmeter-plugins.org/repo/
More information:
Configuring JMeter
Apache JMeter Properties Customization Guide
Unable to connect to SSL services due to "PKIX Path Building Failed" error

How to use multiple SSL certificates (JKS) while performing load runs with JMeter

I need to perform a load run with 100 User Load for an API with certificate-based authentication. I had SIX different certificates in JKS format. I would like to know how can we use all these six certificates while performing a load run. Can we have some configurations like we use CSV Data config for parameterizing data?
I tried by mentioning the path of all six certificates under Keystore properties of the System property file and when I run, Jmeter starts taking the SIX certificates in a sequel, but it didn't work
Is there any other configurations I can use?
Can you please help me in achieving this
Put all your certificates into a Java Keystore
Point JMeter to use the keystore by manipulating javax.net.ssl.keyStore and javax.net.ssl.keyStorePassword system properties
Add Keystore Configuration element which will traverse the certificates in the keystore and use the different certificates for each thread (virtual user)
You can take a look at How to Use Multiple Certificates When Load Testing Secure Websites article which contains step-by-step instructions on setting up keystore and JMeter

SSL Handshake Exception while Load test using Jmeter in Jenkins

Hi I am integrating the Jmeter with the opeshift pipeline using Jenkins to test my API(https). When the Jmeter is trying to send the request to the API I am getting following error:
Non HTTP response code: javax.net.ssl.SSLHandshakeException - Non HTTP response message: java.security.cert.CertificateException: No name matching <> found
I have tried steps to ignore the SSL certificate verification but I am unable to bypass the process.
I have created a spring boot project to run the load test as a pipeline. I am using <groupId>com.lazerycode.jmeter</groupId> and using the the jmeter file with extension .jmx to run in jenkins.
As per SSL Encryption chapter of JMeter Documentation:
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.
If the server requires a client certificate, this can be provided.
So by default JMeter will trust all certificates no matter of their validity, incomplete chain, subject not matching dns hostname, etc.
If might be the case that your application requires JMeter to send client certificate for security reasons, it can be done either using SSL Manager or providing the relevant system properties pointing to the keystore where the certificate lives. See How to Set Your JMeter Load Test to Use Client Side Certificates article for more details

Jmeter-2.3.1 - HTTPS with client certificate

I am using jakarta-jmeter-2.3.1 and needs to call a SOAP webservice over HTTPS. The server needs client side certificate.
Can you please let me know how to refer keystore in earlier version of the jmeter?
I know the latest version (3.2) has Keystore Configuration sampler element, which I could not find in 2.3.1.
[I need to use that versoin because of the client side restriction. ]
You can configure the encryption on JVM level by adding the next lines to system.properties file:
javax.net.ssl.keyStoreType=${keystoretype}
javax.net.ssl.keyStore=/path/to/your/certificate
javax.net.ssl.keyStorePassword=your_certificate_password_here
${keystoretype} can be either pkcs12 for .p12 files or jks for .jks files (this is default). If your certificate is in the different format it will be better to convert it to i.e. .p12 format using OpenSSL or equivalent
you will need to restart JMeter to pick the properties up
See How to Set Your JMeter Load Test to Use Client Side Certificates guide for more detailed information if needed.
JMeter 2.3.1 is highly outdated, more than 1000 bugs and 500 enhancements occured since that one.
Convince your customer to upgrade, you'll gain at all levels:
productivity
quality
performance
reporting

Jmeter: Distributed Testing with client certificates

We set up Jmeter for performance testing over HTTPS with client certificates (via SSL Manager). It works like a charm if we run it from GUI. But, if we start distributed testing we get a bad certificate error.
How to pass the certificates & password to the slaves?
You can configure the certificates using Java SSL System Properties
I.e. add the following lines to system.properties file on each remote slave machine:
javax.net.ssl.keyStore=certificate.p12
javax.net.ssl.keyStorePassword=secr3t
javax.net.ssl.keyStoreType=pkcs12
amend above values to match your settings
JMeter restart will be required to pick the properties up.
You can also pass the values via -D command-line arguments like:
jmeter -Djavax.net.ssl.keyStore=certificate.p12 -Djavax.net.ssl.keyStorePassword=secr3t -s ...
See How to Set Your JMeter Load Test to Use Client Side Certificates article for more detailed explanation.

Resources