Jmeter: Distributed Testing with client certificates - jmeter

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.

Related

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 recording - 'ERR_SSL_PROTOCOL_ERROR' and 'Software caused connection abort: socket write error'

I'm new in JMeter and my topic seems to be very similar to another ones already existing. However, it is not - I was trying already all the solutions for the errors that I get and nothing works :/
I have already set up all proxy settings and certificates, and it's working fine (with the same settings) on the other VM.
Outside the recording, I can see proper 'No Internet' warning:
enter image description here
However, once started recording, there are errors in the console and the front end of the application does not look like originally:
enter image description here
Please help! I've already done all the recommendations for clearing caches, SSL, removing files in Windows32 archive and so on...
You should try recording your script using Blazemeter Chrome Extension. Hope, this resolve your issue.
It might be the case there are differences in machines themselves, not in JMeter settings, for example this No Internet message most probably means that the browser is connected to JMeter's proxy server, but JMeter itself cannot connect to the internet.
Try creating a simple manual Test Plan with a single HTTP Request sampler to open http://example.com website. If the request will be successful - you will need to double check your browser and JMeter configuration. However if you get the UnknownHostException instead it may mean that:
Networking configuration of the machine is incorrect (it cannot access the Internet)
The machine requires an upstream Proxy server in order to be able to access Internet resources so you will need to make JMeter aware of this proxy server by passing appropriate command line arguments to the JMeter startup script:
jmeter -E https -H my.proxy.server -P 8000 -u username -a password -N localhost
in order to make the changes permanent you can define:
http.proxyScheme
http.proxyHost
http.proxyPort
https.proxyHost
https.proxyPort
in system.properties file and http.proxyDomain in user.properties file, check out Apache JMeter Properties Customization Guide for more information on JMeter properties and ways of setting and overriding them

apache jmeter for setting up certificates for massl connection

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

How to manage Proxy in Jmeter

I have to do performance test of a web based application through Jmeter. To connect to the application , I have to be in Client VPN and it has specific proxy to connect. The application will NOT work in Local host..
How to perform this? I tried by running Jmeter from command prompt . Please help .
You can configure JMeter to use proxy in 2 ways:
Command-line
jmeter -H your_proxy_host -P your_proxy_port
Using system.properties (the file lives under "bin" folder of your JMeter installation, add the next lines to it:
http.proxyHost=your_proxy_host
http.proxyPort=your_proxy_port
https.proxyHost=your_proxy_host
https.proxyPort=your_proxy_port
JMeter restart will be required to pick the properties up.
First check that you have the correct proxy parameters like Proxy Server IP/address,port no,username and password.
Then, in the first HTTP Request, click on advanced tab and there you find Proxy server section.
Fill the required information and run the jmeter. Based on the response you can judge where you are able to send the request via proxy or not.
I have used it with proxy server name with username and pwd. For me it worked, by that I means you can try by whatever information you have.
Then, you can set the properties permanently as suggested by Dmitri. Also, it can be set in HTTP Request Default Config.
Check the below link for more information:-
https://jmeter.apache.org/usermanual/component_reference.html#HTTP_Request

using JMeter proxy recorder behind company proxy with SSL manager

Hi I am facing following issue when try to use JMeter proxy recorder behind company proxy
There are two environments one is not using company proxy(QA env) other is using company proxy(UAT env)
Also both sites are using client side certificate to identify user(saml2).
When recording in the QA environment I only need to use ssl manager and when I start the jmeter proxy jmeter will ask for browser certificate password. After providing that I can successfully record the requests.
But when access the UAT env directly I have to set the browser proxy setting (webprox.corp.net and port 2212)
So to record the same application I started JMeter using following command
jmeter.bat -H webprox.corp.net -P 2212
also set the browser proxy settings to localhost and 8080(same as jmeter proxy server settings)
Jmetr recording start fine and requests are captured but it does not evaluate the browser certificate which is loaded in SSL manager. Therefore I am unable to recorded correct scenario as connection says not authorized due to browser certificate unidentification.
Any suggestions on this pls
I have found out the solution for above issue
As stated we can start the JMeter using jmeter.bat -H webprox.corp.net -P 2212 -N localhost (you can use other parameters as required like username and password for the proxy)
Load the valid browser side certificate(not the JMeter root CA) in to the SSL manager(Assume you are not loading certificates from java Keystore)
The main point I have missed was the value in JMter Work Bench > HTTP(S) Test Script Recorder > HTTP Sampler Setting > Type
Had to use Java implementation as Type (or you can change the value and check)
After completing above configurations I have successfully recorded the script from behind the cooperate proxy.

Resources