11

I try to add a p12 file to JMeter 3.3 configuration to reach a site. I added following lines to system.properties file:

javax.net.ssl.keyStoreType=pkcs12    
javax.net.ssl.keyStore=C:\certs\mycert.p12
javax.net.ssl.keyStorePassword=mypassword

After that I restarted JMeter, but got the same error, javax.net.ssl.SSLHandshakeException. I converted p12 file with keytool to jks and added the following lines to same file by replacing previous ones.

javax.net.ssl.keyStore=C:\certs\mycert.jks
javax.net.ssl.keyStorePassword=mypassword

Error message is the same in this case too:

Response code: Non HTTP response code: javax.net.ssl.SSLHandshakeException Response message: Non HTTP response message: Received fatal alert: handshake_failure

I use HTTP Client 4 as implementation for HTTP Samplers. When I import same certificate to browser, it is working correctly.

I tried to follow this tutorial too: How to configure JMeter to use client side SSL

Chirag Maliwal
  • 442
  • 11
  • 25
plaidshirt
  • 5,189
  • 19
  • 91
  • 181
  • 1
    Did you check tutorial https://developer.ibm.com/mainframe/docs/how-to-test-your-apis/how-to-configure-jmeter-to-use-client-side-ssl/? – Ori Marko Dec 07 '17 at 06:41
  • @user7294900 : Yes, sure, but it doesn't helped. – plaidshirt Dec 07 '17 at 07:18
  • 2
    set `javax.net.debug=ssl:handshake:verbose` and see what it says about actual reason for handshake to fail – timbre timbre Dec 12 '17 at 16:57
  • @KirilS. : Is it possible to import it on project-level? So it could be saved and shipped with `.jmx` file. – plaidshirt Dec 13 '17 at 09:19
  • 1
    with jmx file - no. You can change them on the fly (for example by providing command line with cert location, or using system.properties), but certificates really have nothing to do with JMeter, they are set on JVM level (see: https://docs.oracle.com/cd/E19830-01/819-4712/ablqw/index.html), so accepting or not recognizing it still depends on Java installed on each machine. So it's usually better to consider them to be part of system requirements for JMeter. – timbre timbre Dec 13 '17 at 15:45

1 Answers1

7

You can use Options -> SSL Manager option, where you can select your .p12 file to be used in current Test plan.

plaidshirt
  • 5,189
  • 19
  • 91
  • 181