简体   繁体   English

Apache JMeter录制问题403 Apache Tomcat

[英]Apache JMeter recording issue 403 Apache Tomcat

My application is accessible via Safari browser but while I am recording it using JMeter, after the SSO authentication I am getting a 403 access denied. 通过Safari浏览器可以访问我的应用程序,但是当我使用JMeter对其进行记录时,在SSO身份验证之后,我得到了403访问被拒绝的信息。

It appears to be a certificate related issue, as while recording, the browser prompts that the certificate is not trusted and I hit continue. 它似乎是与证书有关的问题,因为在录制时,浏览器会提示该证书不受信任,我点击继续。

The server is Apache Tomcat. 服务器是Apache Tomcat。

Ia m using JMeter 2.11 and while recording, I am using the HTTPS proxy which is generating the CA certificate in the bin directory. 我使用JMeter 2.11并在记录时使用HTTPS代理,该代理在bin目录中生成CA证书。

I also tried installing the certificate in Firefox and tried that too but no luck. 我也尝试在Firefox中安装证书,但也尝试过,但是没有运气。

Here is the method I use to test SSL sites with Jmeter: 这是我使用Jmeter测试SSL站点的方法:

  1. I recommend using Java 1.7.0_xx 我建议使用Java 1.7.0_xx
  2. Clone this project and run Jmeter from it: https://github.com/djangofan/run-jmeter-with-plugins-via-build-tools 克隆该项目并从中运行Jmeter: https : //github.com/djangofan/run-jmeter-with-plugins-via-build-tools
  3. Open browser, hit the https (SSL) site that you want to test. 打开浏览器,单击您要测试的https(SSL)站点。
  4. If site is https then then the browser will show a “LOCK” icon that specifies its secure. 如果站点是https,则浏览器将显示一个“ LOCK”图标,用于指定其安全性。
  5. Open the “Certificate Information” and export the certificate as a .pem or .der file. 打开“证书信息”,并将证书导出为.pem或.der文件。
  6. In the 'jre/lib/security' folder of the JDK that you started Jmeter with, edit the security.policy file. 在启动Jmeter的JDK的'jre / lib / security'文件夹中,编辑security.policy文件。 Comment out the line that says: #jdk.certpath.disabledAlgorithms=MD2, RSA keySize < 1024 注释掉以下行: #jdk.certpath.disabledAlgorithms = MD2,RSA keySize <1024
  7. Now using java keytool.exe convert exported file to .jks keytool -importcert -alias mycert -file exportedFile.der -keystore jmeterTrustedKeystore.jks -storepass changeit 现在使用java keytool.exe将导出的文件转换为.jks keytool -importcert -alias mycert -fileexportedFile.der -keystore jmeterTrustedKeystore.jks -storepass changeit
  8. Restart or re-open Jmeter and use the Options → SSL Manager menu to load the .jks keystore. 重新启动或重新打开Jmeter,然后使用选项→SSL管理器菜单加载.jks密钥库。 It should prompt you for the “changeit” password and then Jmeter will remember it. 它会提示您输入“ changeit”密码,然后Jmeter会记住它。
  9. Create a new SSL request and it should now succeed. 创建一个新的SSL请求,它现在应该成功。

Try the following recommendations from Recording HTTPS Traffic with JMeter's Proxy Server guide, to wit: 尝试从使用JMeter的Proxy Server记录HTTPS流量指南中获得以下建议:

  1. Configure your browser to user JMeter's proxy for all protocols 将浏览器配置为使用JMeter的所有协议的代理
  2. Clear your browser's history, cache, cookies, etc. 清除浏览器的历史记录,缓存,Cookie等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM