JMeter https 代理记录不起作用 [英] JMeter https proxy recording not working

查看:41
本文介绍了JMeter https 代理记录不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 JMeter 上录制基于 JSF 的 Web 应用程序的 https 会话,但它无法正常工作.

目标应用程序托管在: AWS
JMeter 版本: 2.9 r1437961
浏览器:Chrome 版本 29.0.1547.65
Java:Java 版本1.6.0_27"
OpenJDK 运行时环境 (IcedTea6 1.12.5) (6b27-1.12.5-0ubuntu0.12.04.1)
OpenJDK Server VM(构建 20.0-b12,混合模式)
操作系统:Ubuntu 12.04

代理服务器配置:
端口:8084
目标控制器:测试计划 > 线程组
已检查捕获 HTTP 标头.
HTTP 示例设置:
类型:未选择.遵循重定向并选中使用 KeepAlive.

要排除的网址格式:
1. 添加了建议排除
2. .*.jsf

抛出的异常(来自 JMeter.log):

错误 - jmeter.protocol.http.proxy.Proxy: java.net.SocketException: 连接被远程主机关闭在 sun.security.ssl.SSLSocketImpl.checkWrite(SSLSocketImpl.java:1377)在 sun.security.ssl.AppOutputStream.write(AppOutputStream.java:62)在 java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)在 java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)在 org.apache.jmeter.protocol.http.proxy.Proxy.writeToClient(Proxy.java:404)在 org.apache.jmeter.protocol.http.proxy.Proxy.run(Proxy.java:218)错误 - jmeter.protocol.http.proxy.Proxy:SSL 证书有问题?确保浏览器设置为接受 JMeter 代理证书:远程主机关闭连接 java.net.SocketException:远程主机关闭连接在 sun.security.ssl.SSLSocketImpl.checkWrite(SSLSocketImpl.java:1377)在 sun.security.ssl.AppOutputStream.write(AppOutputStream.java:62)在 java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)在 java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)在 org.apache.jmeter.protocol.http.proxy.Proxy.writeToClient(Proxy.java:404)在 org.apache.jmeter.protocol.http.proxy.Proxy.run(Proxy.java:218)


我正在执行的步骤是:
1.设置代理服务器指向8084.
2. 从 chrome 更改代理设置:将 https 代理设置为 8084.
3. 禁用所有 chrome 扩展程序和 chrome 帐户.
4.启动jmeter代理服务器并点击https://url/login
5. 浏览器上出现证书确认页面.同时,jmeter.log 显示:

 2013/09/11 13:16:30 INFO - jmeter.protocol.http.proxy.Daemon:在端口上创建守护程序套接字:80842013/09/11 13:16:30 信息 - jmeter.protocol.http.proxy.Daemon:代理启动并运行!2013/09/11 13:22:39 INFO - jmeter.protocol.http.proxy.Proxy:代理将删除标头:If-Modified-Since,If-None-Match,Host2013/09/11 13:22:39 信息 - jmeter.protocol.http.proxy.Proxy:打开的密钥库文件:/home/abhijeet/Automation_Dev/LoadAutomation/Jmeter/apache-jmeter-2.9/bin/proxyserver.jks2013/09/11 13:22:39 信息 - jmeter.protocol.http.proxy.Proxy:用于 SSL 的密钥库加载正常并将主机放入地图 (clients4.google.com)2013/09/11 13:22:39 信息 - jmeter.protocol.http.proxy.Proxy:打开的密钥库文件:/home/abhijeet/Automation_Dev/LoadAutomation/Jmeter/apache-jmeter-2.9/bin/proxyserver.jks2013/09/11 13:22:39 信息 - jmeter.protocol.http.proxy.Proxy:用于 SSL 的密钥库加载正常并将主机放入地图 (translate.googleapis.com)2013/09/11 13:22:40 信息 - jmeter.protocol.http.sampler.HTTPHCAbstractImpl:本地主机 = abhijeet-desktop2013/09/11 13:22:40 信息 - jmeter.protocol.http.sampler.HTTPHC4Impl:HTTP 请求重试次数 = 12013/09/11 13:22:40 信息 - jmeter.protocol.http.sampler.HTTPHC4Impl:设置 HTTPS TrustAll 方案2013/09/11 13:22:40 信息 - jmeter.protocol.http.proxy.FormCharSetFinder:使用 htmlparser 版本:2.0(2006 年 9 月 17 日发布)<br>

6.线程组开始显示对这些域的未知请求:

<块引用>

1.translate.googleapis.com2.clients4.google.com3. www.google.co.in4. www.google.com5. ssl.gstatic.com6. safebrowsing.google.com7. alt1-safebrowsing.google.com8.clients4.google.com9. www.gstatic.com..n 发送到目标应用程序的所有其他请求.

(对于每个请求都会抛出上述异常)

我相信,上面的 google 域请求正在被记录,因为 chrome 正在动态搜索 google 上的关键字,而我正在地址栏中键入 url 字符串.但我不希望这些请求被记录在线程组中.

此外,我尝试了这些页面中的解决方案,但它们对我不起作用:
链接 1
链接 2
链接 3

我不明白,为什么 JMeter 不能使用它已经拥有的假证书.我检查了 chrome 中的 SSL 设置,但找不到任何 JMeter 证书.需要帮助!!

解决方案

我遇到了同样的问题,解决了信任证书.就像我看着

时的你

选项>高级 >证书 >查看证书 ==>当局

并且看不到名称 ApacheJMeterRootCertificate.crt 或相关名称,但我意识到有一个类似于

的名称<块引用>

_请勿安装,除非这是您的证书

我单击此对象和此对象下的Edit_Trust"这两个项目.我分享我的截图.我希望这可以帮助您和其他人.

我使用火狐浏览器.在 chrome 上应该有类似的方法来编辑证书.

I am recording a https session of a JSF based web app on JMeter and it's not working.

Target application is hosted on: AWS
JMeter version: 2.9 r1437961
Browser: Chrome version 29.0.1547.65
Java: java version "1.6.0_27"
OpenJDK Runtime Environment (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 server config:
Port: 8084
Target Controller: Test Plan > Thread Group
Capture HTTP headers is checked.
HTTP Sample settings:
Type: not selected. Follow Redirects and Use KeepAlive checked.

URL patterns to exclude:
1. Added Suggested Excludes
2. .*.jsf

Exceptions that are getting 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 am following are:
1. Set proxy server pointing to 8084.
2. Change proxy settings from chrome: Set https proxy to 8084.
3. Disabled all chrome extensions and chrome account.
4. Started jmeter proxy server and hit https://url/login
5. Certificate confirmation page appears on 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. 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.

(For every request the above exceptions are thrown)

I believe, the google domain requests above are getting recorded because chrome is dynamically searching the keywords on google, while I am typing the url string in the address bar. But I don't want these requests to get recorded in the Thread Group.

Also, I tried the solutions from these pages but they didn't work for me:
Link 1
Link 2
Link 3

I don't understand, why is JMeter not able to 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!!

解决方案

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

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

and couldn't see a name ApacheJMeterRootCertificate.crt or a related name, but i realize that there is a name something like

_DO NOT INSTALL unless this is your certificate

I click this object and 'Edit_Trust' both item under this object. I share my screenshot. I hope this can be help you and others.

I use Firefox. At chrome there should be similar way to edit the certificate.

这篇关于JMeter https 代理记录不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆