JMeter https proxy record not working

I am recording a https session of a web application in JSF on JMeter and not working.

Target application hosted on: AWS
JMeter Version: 2.9 r1437961
Browser: Chrome Version 29.0.1547.65
Java: java version "1.6.0_27"
OpenJDK workspace (IcedTea6 1.12.5) (6b27-1.12.5-0ubuntu0.12.04.1)
OpenJDK Server VM (Build 20.0-b12, Mixed Mode)
OS: Ubuntu 12.04

Proxy Configuration:
Port: 8084
Target Controller: Test Plan> Thread Group
Capturing HTTP headers. HTTP Sample Settings:
Type: not selected. Watch for redirects and use KeepAlive.

URL patterns to exclude:
1. Added sentence Exclude
2 .. * \. Jsf

Exceptions that are thrown (from JMeter.log):

ERROR - jmeter.protocol.http.proxy.Proxy: java.net.SocketException: Connection closed by remote host at sun.security.ssl.SSLSocketImpl.checkWrite(SSLSocketImpl.java:1377) at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:62) at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140) at org.apache.jmeter.protocol.http.proxy.Proxy.writeToClient(Proxy.java:404) at org.apache.jmeter.protocol.http.proxy.Proxy.run(Proxy.java:218) ERROR - jmeter.protocol.http.proxy.Proxy: Problem with SSL certificate? Ensure browser is set to accept the JMeter proxy cert: Connection closed by remote host java.net.SocketException: Connection closed by remote host at sun.security.ssl.SSLSocketImpl.checkWrite(SSLSocketImpl.java:1377) at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:62) at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140) at org.apache.jmeter.protocol.http.proxy.Proxy.writeToClient(Proxy.java:404) at org.apache.jmeter.protocol.http.proxy.Proxy.run(Proxy.java:218) 


The steps I follow are as follows:
1. Install a proxy server pointing to 8084.
2. Change the proxy server settings: Set the https proxy to 8084.
3. Disable all chrome extensions and the chrome account.
4. Launched the jmeter proxy and clicked https://url/login
5. The certificate confirmation page appears in the browser. Meanwhile, jmeter.log shows:

  2013/09/11 13:16:30 INFO - jmeter.protocol.http.proxy.Daemon: Creating Daemon Socket on port: 8084 2013/09/11 13:16:30 INFO - jmeter.protocol.http.proxy.Daemon: Proxy up and running! 2013/09/11 13:22:39 INFO - jmeter.protocol.http.proxy.Proxy: Proxy will remove the headers: If-Modified-Since,If-None-Match,Host 2013/09/11 13:22:39 INFO - jmeter.protocol.http.proxy.Proxy: Opened Keystore file: /home/abhijeet/Automation_Dev/LoadAutomation/Jmeter/apache-jmeter-2.9/bin/proxyserver.jks 2013/09/11 13:22:39 INFO - jmeter.protocol.http.proxy.Proxy: KeyStore for SSL loaded OK and put host in map (clients4.google.com) 2013/09/11 13:22:39 INFO - jmeter.protocol.http.proxy.Proxy: Opened Keystore file: /home/abhijeet/Automation_Dev/LoadAutomation/Jmeter/apache-jmeter-2.9/bin/proxyserver.jks 2013/09/11 13:22:39 INFO - jmeter.protocol.http.proxy.Proxy: KeyStore for SSL loaded OK and put host in map (translate.googleapis.com) 2013/09/11 13:22:40 INFO - jmeter.protocol.http.sampler.HTTPHCAbstractImpl: Local host = abhijeet-desktop 2013/09/11 13:22:40 INFO - jmeter.protocol.http.sampler.HTTPHC4Impl: HTTP request retry count = 1 2013/09/11 13:22:40 INFO - jmeter.protocol.http.sampler.HTTPHC4Impl: Setting up HTTPS TrustAll scheme 2013/09/11 13:22:40 INFO - jmeter.protocol.http.proxy.FormCharSetFinder: Using htmlparser version: 2.0 (Release Build Sep 17, 2006)<br> 

6. The thread group starts showing unknown requests to these domains:

 1. translate.googleapis.com 2. clients4.google.com 3. www.google.co.in 4. www.google.com 5. ssl.gstatic.com 6. safebrowsing.google.com 7. alt1-safebrowsing.google.com 8. clients4.google.com 9. www.gstatic.com . . n all other requests going to the target application. 

(Exceptions are thrown for each request)

I believe that the google domain requests described above are recorded because chrome dynamically searches for keywords in google, while I type the url string in the address bar. But I do not want these requests to be logged in the thread group.

In addition, I tried the solutions from these pages, but they did not work for me:
Link 1
Link 2
Link 3

I do not understand why JMeter cannot use the fake certificate that it already has. I checked the SSL settings in chrome and I could not find any JMeter certificates. Need help!

+4
source share
4 answers

I have the same problem and I decided to trust the certificate. Just like you when I look at

 Options > Advanced > Certificates > View Certificates ==> Authorities 

and could not see the name ApacheJMeterRootCertificate.crt or the name associated with it, but I understand that there is something like

_DO NOT INSTALL if this is your certificate

I click on this object and "Edit_Trust" both elements under this object. I am sharing my screenshot. Hope this helps you and others.

I am using Firefox. In chrome there should be a similar way to edit the certificate.

enter image description here

+2
source

jmeter 2.12 has good support for HTTPS. In WorkBench, simply select Add -> Non-Test Elements -> HTTP (S) Test Script Recorder. This version worked for the first time for me.

0
source

To do this in chrome / IE, we need to put the certificate in the "Trusted Root Certificates Store"

  • Double click the generated certificate
  • Certificate Import Wizard opens
  • Click "Next"
  • Select the second radio button (put all certificates in the next store)
  • Click Browse and select Trusted Root Certificates. Click "Next"
  • Click Finish

Verify your certificate installed in Chrome settings (under Http / SSL). - Certificate Management .. (trusted root certificates tab)

This should eliminate the exceptions that you have selected, as your screenshot shows.

0
source

In recent versions of Google Chrome, it’s difficult to circumvent security settings to avoid security threats such as phishing or man-in-the-center attacks.

I have successfully configured Google Chrome (v.54.0) to allow a self-signed JMeter certificate for HTTP (S) records.

Here are the instructions (on Windows):

  • Open MMC console (SUPER + R, type mmc, press Enter)
  • Select "Add / Remove Snap-In"
  • Choosing the Certificates snap-in for the current user
  • Choose Trusted Root Certification Authorities β†’ Certificates
  • Right-click the Certificates folder and select All Tasks β†’ Import ...
  • Import a self-signed JMeter certificate using a wizard that supports the default settings.
  • After installation, right-click on the self-signed JMeter certificate and select "Properties"
  • On the General tab, make sure the Enable for all purposes option is selected
  • In the cross-certificates, specify the URL of the application you want to write (make sure you enter the full URL, for example https://www.live.com )
  • Close all windows.
  • Done. Now you can reach your goal bypassing the Chrome Security Warning and start recording.
0
source

Source: https://habr.com/ru/post/1501625/