Question

How to add browser certificates to jmeter. I have an application which has an intial certificate page. When this certificate is added to browser, the user can access the other pages. Instead of login page, this procedure is followed. For different users, different certificates are generated in the browser. So, when the user enter the link and the browser has the certificate for that user, home page will be visible to that user.

Was it helpful?

Solution

This blog explains the whole thing:

Also check ref doc:

Using KeyStore component and Variable name holding certificate alias Variable value will be filled from CSV Data Set for example. In the screenshot of ref doc, "certificat_ssl" is a variable from a CSV Data Set.

The process is in summary the following:

  1. Convert your crt files to pkcs7 and add them to keystore (see https://www.sslshopper.com/ssl-converter.html) using one alias per certificate, you should have 7 aliases at end by playing:

    keytool -import -trustcacerts -file certificate1.p7b -keystore path_to_keystore.jks -storepass -alias "myalias1"

    keytool -import -trustcacerts -file certificate2.p7b -keystore path_to_keystore.jks -storepass -alias "myalias2"

    ...

  2. Put the aliases in a CSV file , you should have 7 rows (1 per alias)

  3. Add a CSV Data Set and reference the file you created in previous step, and use as variable name certificat_ssl for example
  4. Reference the keystore you created by adding to jmeter startup options:

    -Djavax.net.ssl.keyStore=path_to_keystore.jks -Djavax.net.ssl.keyStorePassword=password_of_keystore

  5. Ensure you use HTTP Client 4 as implementation for HTTP Samplers

  6. Start playing
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top