Setting up Jmeter to do HTTPS

2020-02-28 03:43发布

问题:

I am using a jmeter 2.7 for my load testing. When we started of the urls to use were simple http. Now we have moved to HTTPS. Can some one tell me how to enable ssl in jmeter? I did go through the jmeter manual and un-commented the SSL portions (all SSL lines now :( ) from system.properties and also have changed the protocol to be HTTPS under Http Request sampler -> Http Request and still no success. I am lost on how to set ssl url in jmeter any help? Link that some one can point me to?

some more info: I'm running jmeter from my mac and it has Java version 1.6.

回答1:

No, you need not to change any system properties. Here is random github https example that works for :



回答2:

I am facing similar issues and now able to run Jmeter version 2.11 successfully with HTTPS. To run it you need to change HTTP request implementation to HTTPClient4 and Protocol to HTTPS.



回答3:

I had the exact same issue using version 2.11 and by changing the Implementation to HttpClient4 and Protocol [http]: to HTTPS in each thread it now works.



回答4:

Three (3) Steps:

1) Open a command line:
openssl s_client -connect hostname:port -showcerts

Copy the 2nd+ certs to notepad or text file, with the BEGIN / END Markers: Application_CA_Public_Cert.cer

2) Create trust store with Java keytool keytool -importcert -alias APPLICATION_NAME_CA_PUBLIC_CERT -file Application_CA_Public_Cert.cer -keystore jmeter_truststore.jks -storepass Password01

3) Update Jmeter system.properties file (per notes in Jmeter, all ssl functionality moved to this file)

JMETER_HOME/bin/system.properties {Jmeter version 2.13}

https.default.protocol=TLSv1 javax.net.ssl.trustStore=C:/jmeter/apache-jmeter-2.13/jmeter_truststore.jks javax.net.ssl.trustStorePassword=Password01



回答5:

I couldn't get this to work.

curl -X GET "https://x.com/PROMOT" -k -H "Authorization: Basic YWRtaW46cGFzcw=="

Would work.

However JMeter 2.13 with https and HttpClient3.1/HttpClient4/Java would error on

javax.net.ssl.SSLException: Received fatal alert: protocol_version

My site used https only.

I did a wireshark and the https curl seems to utilize TLSV1 JMeter seemed to do SSLv3 which did not work. Added this property as it works now.

Added in jmeter.propeties and things work now!

https.default.protocol=TLSv1

Or an argument with jmeter.

 --jmeterproperty https.default.protocol=TLSv1

A side note: https.default.protocol=TLS exists commented in jmeter.properties, But uncommenting that still defaulted to SSLv3. Had to explicitly change it to TLSv1.



回答6:

You need to configure a keystore containing the SSL certificate against javax.net.ssl.trustStore in [apache path]\bin\system.properties.



回答7:

I had a similar issue. I am on jmeter 2.9. When I tried to access https (by setting the protocol to https) I kept getting a 403.

I then set the Implementation to HttpClient3.1 and it worked from there.



回答8:

I had a similar issue. I am on jmeter 3.0. When I tried to access https (by setting the protocol to https) I kept getting a 403.

I then set the Implementation to HttpClient4 and then protocol to https from that instant it started working perfectly.



标签: ssl https jmeter