JMeter : How to record HTTPS traffic?

做~自己de王妃 提交于 2019-12-17 05:11:51

问题


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?


回答1:


  1. Starting from JMeter 3.0 default port for the HTTP(S) Test Script Recorder is 8888

  2. The easiest way to configure recording is using JMeter Templates feature. From JMeter's main menu select:

    File -> Templates -> Recording -> Create
    

  1. 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

  1. 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.

    1. To Import this Root CA certificate in Firefox (it is located in jmeter/bin folder) for example:

  1. 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



回答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.




回答3:


What I do is:

  1. Go to my website using my web server's IP-address (i.e. http://2.2.2.2/login.html)
  2. Start the recorder and run through my test case
  3. Stop recording
  4. 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
  5. 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.




回答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




回答5:


Is there any other way to record HTTPS than Bad boy and Https spoofing?

Yes--use a nightly build of JMeter, e.g. version r922204.




回答6:


Https recording is successfully working in new version of Jmeter 2.9 as of today. I had to import proxy certificate and play around with Firefox to get this working.

Refer this link for more information Https recording using Jmeter




回答7:


Yes, I have used it with "attempt HTTPS spoofing" on. Things are simple enough:

  1. Turn HTTPS Spoofing on (of course).
  2. Make sure that the browser sends Http request to Jmeter, so that Jmeter can record it and then send the encrypted request back to the server. So, the URL in the browser should start with http:// (and not with https://). The details could be found in my blog.

Please let me know if it works for you.




回答8:


I am using Webscarab to record https and ajax conversations. It workd fine. I extended the Webscarab with export function for Jmeter. Bugzilla 48898.



来源:https://stackoverflow.com/questions/299529/jmeter-how-to-record-https-traffic

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!