Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ignore/Turn off verification of the certificate in Jmeter/Java

I am testing HTTPS Requests to a custom server using JMeter, but the certificate that the custom server returns in untrusted (as this is a development server). Because of this, the requests fail as it needs a signed/verified CA Certificate.

Is there a way to turn off Jmeter's certificate verification similar to curl (-k option) ?

like image 299
sidman Avatar asked Oct 26 '15 05:10

sidman


1 Answers

JMeter does not validate certificates by default, it ignores all certificate errors such as expiry and incorrect hostname. https://cwiki.apache.org/confluence/display/JMETER/JMeterAndHTTPS

If you are still facing this issue, then you can explicitly mention the properties to ignore ssl certificate check. It can be done in two ways,

  1. Add a JMeter start-up configuration. You just have to look for the jmeter.properties file and add the code line ‘server.rmi.ssl.disable=true’

  2. Executing Jmeter through command line by passing parameter to rewrite properties of the configuration files at start-up,

    jmeter -s -Jserver.rmi.ssl.disable=true

Also check if correct headers are passed,

Accept-Enconding= application/json
Content-Type= application/json
like image 134
Vishal Kharde Avatar answered Sep 25 '22 16:09

Vishal Kharde