我试图在jmeter 4.0上运行Http测试脚本记录时收到以下错误

时间:2018-05-17 11:26:40

标签: java jmeter localhost

尝试在jmeter 4.0上运行Http Test Script Record时出现以下错误:

java.io.IOException:   >> keytool error: java.lang.RuntimeException: java.io.IOException: DNSName components must consist of letters, digits, and hyphens <<
Command failed, code: 1
'keytool -genkeypair -alias http://localhost:8787/hammer/home#/home -dname "cn=http://localhost:8787/hammer/home#/home, o=JMeter Proxy (TEMPORARY TRUST ONLY)" -keyalg RSA -keystore proxyserver.jks -storepass {redacted} -keypass {redacted} -validity 7 -ext san=dns:http://localhost:8787/hammer/home#/home'
    at org.apache.jorphan.exec.KeyToolUtils.genkeypair(KeyToolUtils.java:171) ~[jorphan.jar:4.0 r1823414]
    at org.apache.jorphan.exec.KeyToolUtils.generateSignedCert(KeyToolUtils.java:285) ~[jorphan.jar:4.0 r1823414]
    at org.apache.jorphan.exec.KeyToolUtils.generateHostCert(KeyToolUtils.java:276) ~[jorphan.jar:4.0 r1823414]
    at org.apache.jmeter.protocol.http.proxy.ProxyControl.initDynamicKeyStore(ProxyControl.java:1540) ~[ApacheJMeter_http.jar:4.0 r1823414]
    at org.apache.jmeter.protocol.http.proxy.ProxyControl.initKeyStore(ProxyControl.java:1447) ~[ApacheJMeter_http.jar:4.0 r1823414]
    at org.apache.jmeter.protocol.http.proxy.ProxyControl.startProxy(ProxyControl.java:530) [ApacheJMeter_http.jar:4.0 r1823414]
    at org.apache.jmeter.protocol.http.proxy.gui.ProxyControlGui.startProxy(ProxyControlGui.java:569) [ApacheJMeter_http.jar:4.0 r1823414]
    at org.apache.jmeter.protocol.http.proxy.gui.ProxyControlGui.actionPerformed(ProxyControlGui.java:424) [ApacheJMeter_http.jar:4.0 r1823414]
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) [?:1.8.0_171]
    at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) [?:1.8.0_171]
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) [?:1.8.0_171]
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source) [?:1.8.0_171]

我已将http域名设为http://localhost:8787/hammer/home#/home,将port设置为8888。还配置了手动proxy settings: address- localhost, port: 8888. 我的证书也已下载。

1 个答案:

答案 0 :(得分:0)

您需要将域名保持为localhost,因为它必须与preferred domain name syntax相对应。

另外一般情况下,您甚至不需要配置任何额外的细节以便能够记录HTTP流量,除非您不记录HTTPS - 不需要像JMeter那样生成密钥库&#39 ; HTTP(S) Test Script Recorder能够在没有MITM代理的情况下拦截不安全的流量。

因此我建议还原您的更改,以防止JMeter Proxy启动并使用默认配置记录您的用例。