2013-03-01 135 views
3

我嘗試在使用自簽名SSL證書的網站上執行性能測試。通過Apache JMeter連接到自簽名SSL網站

我的JMeter測試計劃在「常規」SSL站點(具有正確簽名的證書)和無SSL測試頁上正常工作。只要我訪問測試頁面(使用自簽名證書),JMeter只會產生錯誤。我曾嘗試:

  1. 存儲在證書(通過瀏覽器),並將其導入的Java(通過控制面板的「Java」)

  2. 添加的證書的密鑰庫,並通過了以下條命令開始JMeter的線(I沒有其他知道如何以另一種方式?「引用密鑰存儲在JVM」)

    Java的罐子「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 

回答