Pages

Monday 30 January 2017

JMeter - Config Element - "Keystore Configuration"

PerfMatrix - Jmeter Keystore
Apache JMeter’s Keystore configuration element helps to configure Client’s side certificate. Some systems require a Client-side certificate which helps the server to know exactly who is connecting. Today, in many organizations internal users must install and present a certificate when communicating with the server in order to receive authorization to log into the organization’s IT system. Such a scenario can be simulated using the Keystore Configuration element of Apache JMeter.
Before adding a Keystore Configuration element, you must set up a Java Key Store with the client certificates that you want to test. Follow the below steps:
  • Create your certificates either with Java keytool utility or through your PKI and converting them to a format acceptable by JKS: If you have a PKCS12 file, use the following command line to convert it to a JKS file:
keytool -importkeystore -srckeystore certificate.p12 -srcstoretype PKCS12
-srcstorepass <certificate_password>
-keystore <keystore_filename>-storepass <stored_password>
  • Changes need to be done in system.properties file (if not available (or commented) then add (or uncomment) them:
javax.net.ssl.keyStore=path_to_keystore
javax.net.ssl.keyStorePassword=password_of_keystore
  • Change your HTTP sampler implementation to Java (instead of HC3.1 or HC4)
How to add "Keystore Configuration" element?
You can follow below steps to add Keystore Configuration:
1. Select "Test Plan" node
2. Right click on "Test Plan" node
3. Mouse hovers "Add"
4. Mouse hovers "Config Element"
5. Click "Keystore Configuration" 


How to remove "Keystore Configuration" element?
You can follow below steps:
1. Select "Keystore Configuration" node
2. Right click on "Keystore Configuration" node
3. Click "Remove" (Mouse) or "Delete" button from the keyboard
4. Click "Yes"

What are the attributes of "Keystore Configuration" element?
"Keystore Configuration" has below attributes:
  • Name: To provide element name
  • Comments: To provide arbitrary comments (if any)
  • Preload: This option helps you to choose whether you want preload Keystore or not?
  • Variable name holding certificate aliasVariable name that will contain the alias to use for authentication by client certificate.
  • Alias Start IndexThe index of the first key to use in Keystore, 0-based
  • Alias End IndexThe index of the last key to use in Keystore, 0-based. When using "Variable name holding certificate alias" ensure it is large enough so that all keys are loaded at startup. 
PerfMatrix - Jmeter Keystore

How to verify?
To verify keystore creation and loading, view JMeter log file  
2016/01/03 11:09:15 INFO  - jmeter.util.SSLManager: JmeterKeyStore Location: testKeystore.jks type JKS
2016/01/03 11:09:15 INFO  - jmeter.util.SSLManager: KeyStore created OK
2016/01/03 11:09:15 INFO  - jmeter.util.SSLManager: Total of 1 aliases loaded OK from keystore

Next Topic:
Apache JMeter - "LDAP Extended Request Defaults" Element

Previous Topic:
Apache JMeter - "JDBC Connection Configuration" Element

Related Topics:

No comments:

Post a Comment