1

How can I set system.properties of JMeter for mutual authentication? I have to set trustore and keystore but I have 3 pem file: ca.pem , cert.pem , privkey.pem. Is there a way to easily convert pem file in jks?

Riccardo Califano
  • 1,317
  • 3
  • 10
  • 19

1 Answers1

1

You can convert your PEM certificates into a .p12 keystore using OpenSSL tool like:

openssl pkcs12 -export -out jmeterkeystore.p12 -inkey privkey.pem -in cert.pem -CAfile ca.pem

Once done you can point JMeter to use the generated jmeterkeystore.p12 by adding the next lines to JMeter's system.properties file:

javax.net.ssl.keyStoreType=pkcs12    
javax.net.ssl.keyStore=/path/to/your/jmeterkeystore.p12
javax.net.ssl.keyStorePassword=your_keystore_password_here 

Once you do this and restart JMeter you will be able to access the endpoints which require client certificates.

Another way to convert PEM files into a .JKS or .P12 keystore is using a GUI-based tool like KeyStore Explorer

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • Thank you for your answer. In command that you have shown you indicate also CA file that have to verify cert.pem, right? If yes, I'm not able to do that because I don't know the CA against cert.pem has to be verified. I just want to convert cert.pem and privkey.pem in jks or pkcs12 and use them for keystore. – Riccardo Califano Jul 17 '20 at 09:25