【问题标题】:Connect to self-signed SSL website via Apache JMeter通过 Apache JMeter 连接到自签名 SSL 网站
【发布时间】:2013-03-01 17:07:50
【问题描述】:

我尝试在使用自签名 SSL 证书的网站上进行性能测试。

我的 JMeter 测试计划在“普通”SSL 站点(使用正确签名的证书)和没有 SSL 的测试页面上运行正常。一旦我访问测试页面(使用自签名证书),JMeter 只会产生错误。我尝试过的:

  1. 存储证书(通过浏览器)并将其导入 Java(通过控制面板“Java”)

  2. 将证书添加到密钥库并通过以下命令行启动 JMeter(我不知道如何以另一种方式“引用 JVM 中的密钥库”?!)

    java -jar "ApacheJMeter.jar" -Djavax.net.ssl.keyStore="C:\Program Files\Java\jre7\lib\security\cacerts" -Djavax.net.ssl.keyStorePassword=changeit

感谢提示如何让 JMeter 访问测试页面 :)

当前结果(JMeter 输出)为:

javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
    at sun.reflect.GeneratedConstructorAccessor28.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection$6.run(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection$6.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.net.www.protocol.http.HttpURLConnection.getChainedException(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    at java.net.HttpURLConnection.getResponseCode(Unknown Source)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(Unknown Source)
    at org.apache.jmeter.protocol.http.sampler.HTTPJavaImpl.readResponse(HTTPJavaImpl.java:264)
    at org.apache.jmeter.protocol.http.sampler.HTTPJavaImpl.sample(HTTPJavaImpl.java:520)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1088)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1077)
    at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:428)
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256)
    at java.lang.Thread.run(Unknown Source)
Caused by: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
    at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
    at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
    at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)
    at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(Unknown Source)
    at java.net.URLConnection.getHeaderFieldLong(Unknown Source)
    at java.net.URLConnection.getContentLengthLong(Unknown Source)
    at java.net.URLConnection.getContentLength(Unknown Source)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getContentLength(Unknown Source)
    at org.apache.jmeter.protocol.http.sampler.HTTPJavaImpl.readResponse(HTTPJavaImpl.java:230)
    ... 7 more
Caused by: java.io.EOFException: SSL peer shut down incorrectly
    at sun.security.ssl.InputRecord.read(Unknown Source)
    ... 21 more

【问题讨论】:

    标签: apache ssl jmeter


    【解决方案1】:

    看看这个答案:JMeter and optional SSL client certificate 在 JMeter HTTP 请求中查看你的端口号。 https 的标准端口是 443。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-08-30
      • 2014-06-17
      • 1970-01-01
      相关资源
      最近更新 更多