Perform load testing with nCipher HSM
This task describes how to set up a script to load test an environment with an nCipher HSM (Hardware Security Module).
-
Prerequisite: Generate the client certificate file (client_cert.pem) with the private key (client_key.pem) pointing to the private keys stored in the HSM. Make sure that you can connect to your web server (A.com) with a generated CA file (ca-certs.pem). The successful openssl command should have the following form:
openssl s_client –connect A.com:443 –CAfile ca-certs.pem –cert client_cert.pem –certform PEM –key client_key.pem – keyform PEM –engine CHIL
-
Set up the PATH environment variable:
- Add the nfhwcrhk.dll file, usually located in C:\Program Files (x86)\nCipher\nfast\toolkits\hwcrhk, to the PATH environment variable.
- Restart VuGen to apply the changes.
-
Enable nCipher key retrieval
- In the runtime settings, go to the Internet Protocol > Preferences view and expand the Authentication section.
- Select the Enable retrieving keys from nCipher HSM option. For details, see Preferences View - Internet Protocol.
-
Edit the Vuser script
Add the following content to the vuser_init section of your Vuser script.
web_set_sockets_option(SSL_VERSION, "TLS");
web_set_sockets_option(DEFAULT_VERIFY_PATH, <full_path>\ca-certs.pem);
web_set_certificate_ex (
"CertFilePath=<full_path_to_client_cert_file>/client_cert.pem",
"CertFormat=PEM",
"KeyFilePath= <full_path_to_client_private_key_file> /client_key.pem",
"KeyFormat=PEM",
LAST);