JMeter : How to record HTTPS traffic?
I'm using Apache JMeter 2.3, which now supports "attempt HTTPS spoofing" under the Proxy Server element.
I've tried this on several different servers, and have had no success. Has anyone been able to successfully record from an HTTPS source with this setting?
Or barring successfully recording, can anyone share a work-around? When available, I simply have HTTPS turned off at the server level, but this is not always feasible. Thoughts?
Solution 1:
Starting from JMeter 3.0 default port for the HTTP(S) Test Script Recorder is
8888
-
The easiest way to configure recording is using JMeter Templates feature. From JMeter's main menu select:
File -> Templates -> Recording -> Create
-
Don't forget to start the recorder :
- In JMeter < 4.0, Expand "Workbench", if >= 4.0, ignore this step
- Select "HTTP(S) Test Script Recorder"
- Click "Start" button
- You will see a message regarding
Root CA Certificate
. Click OK:
-
it is OK, it informs you JMeter has created a Root Certificate Authority that you need to import in your browser to be able to record correctly HTTPS traffic.
- To Import this Root CA certificate in Firefox (it is located in jmeter/bin folder) for example:
- Configure browser to use JMeter as proxy:
It is now Ok.
- You can navigate to your application, samplers will be created under "Recording Controller" which is under "Thread Group" element
Solution 2:
While the JMeter proxy already has the ability to record HTTPS requests, a Chrome Extension that creates JMeter script came out recently: https://chrome.google.com/webstore/detail/blazemeter-the-load-testi/mbopgmdnpcbohhpnfglgohlbhfongabi?hl=en
It uses a BlazeMeter as the middleman (a commercial JMeter in the cloud service) but you can use their free service forever and still use the plugin to record a JMX script and download it locally to your own machine even if you never use any of the paid plans.
Solution 3:
What I do is:
- Go to my website using my web server's IP-address (i.e. http://2.2.2.2/login.html)
- Start the recorder and run through my test case
- Stop recording
- Replace all values of the IP address with the domain name (i.e. replace 2.2.2.2 with yoursite.com) from the HTTP Request Samplers
- Set the protocol to https in the HTTP Request Samplers
If you have more than a few pages, it's easiest to create an HTTP Request Defaults item, and set your domain name and protocol there.
FYI, I'm using the latest stable build as of 2010-05-24: Jmeter 2.3.4 r785646.
Solution 4:
The newest version of Jmeter (2.4) now supports HTTPS recording. Rejoice!
More details: http://wiki.apache.org/jmeter/JMeterFAQ#Can_JMeter_record_HTTPS_requests_using_the_recording_proxy.3F