Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Jmeter 2.11:获取未经身份验证的对等方_Java_Ssl_Jmeter_Ssl Certificate_Performance Testing - Fatal编程技术网

Java Jmeter 2.11:获取未经身份验证的对等方

Java Jmeter 2.11:获取未经身份验证的对等方,java,ssl,jmeter,ssl-certificate,performance-testing,Java,Ssl,Jmeter,Ssl Certificate,Performance Testing,我得到以下列出的例外情况: javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated at sun.security.ssl.SSLSessionImpl.getPeerCertificates(Unknown Source) at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:128)

我得到以下列出的例外情况:

 javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
        at sun.security.ssl.SSLSessionImpl.getPeerCertificates(Unknown Source)
        at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:128)
        at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:572)
        at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
        at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:294)
        at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:640)
        at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:479)
        at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
        at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
        at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:284)
        at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
        at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.followRedirects(HTTPSamplerBase.java:1390)
        at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.resultProcessing(HTTPSamplerBase.java:1461)
        at org.apache.jmeter.protocol.http.sampler.HTTPAbstractImpl.resultProcessing(HTTPAbstractImpl.java:251)
        at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:356)
        at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
        at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1075)
        at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1064)
        at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:426)
        at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:255)
        at java.lang.Thread.run(Unknown Source)
Jmeter.properties中的属性:

> #https.default.protocol=TLS
> #https.default.protocol=SSLv3
> #https.socket.protocols=SSLv2Hello SSLv3 TLSv1
JDK版本:1.7

1.我已导入所需的证书。 2.我尝试设置https.socket.protocols=SSLv3[https://bz.apache.org/bugzilla/show_bug.cgi?id=54759]
3.我已将实现更改为HTTPClient4 4.该证书的有效期为2022年

但它不起作用。请提出解决方案

更新:

           2020/09/23 13:32:07 INFO  - jmeter.util.HttpSSLProtocolSocketFactory: Using protocol list: SSLv3 
2020/09/23 13:32:07 INFO  - jmeter.util.JsseSSLManager: Using default SSL protocol: SSLv3 
2020/09/23 13:32:07 INFO  - jmeter.util.JsseSSLManager: SSL session context: per-thread 
2020/09/23 13:32:07 DEBUG - jmeter.util.JsseSSLManager: ssl Provider =  null 
2020/09/23 13:32:07 DEBUG - jmeter.util.JsseSSLManager: SSL stuff all set 
2020/09/23 13:32:07 DEBUG - jmeter.util.JsseSSLManager: JsseSSLManager installed 
2020/09/23 13:32:14 DEBUG - jmeter.protocol.http.sampler.HTTPHC4Impl: notifyFirstSampleAfterLoopRestart 
2020/09/23 13:32:15 DEBUG - jmeter.protocol.http.sampler.HTTPHC4Impl: Created new HttpClient: @******** 
2020/09/23 13:32:15 DEBUG - jmeter.protocol.http.control.HC3CookieHandler: Found 0 cookies for https:*******
2020/09/23 13:32:15 DEBUG - jmeter.util.JsseSSLManager: Creating threadLocal SSL context for: test
2020/09/23 13:32:15 INFO  - jmeter.util.SSLManager: JmeterKeyStore Location:  type JKS 
2020/09/23 13:32:15 INFO  - jmeter.util.SSLManager: KeyStore created OK 
2020/09/23 13:32:15 WARN  - jmeter.util.SSLManager: Keystore file not found, loading empty keystore 
2020/09/23 13:32:15 DEBUG - jmeter.util.SSLManager: JmeterKeyStore type: class org.apache.jmeter.util.keystore.JmeterKeyStore 
2020/09/23 13:32:15 DEBUG - jmeter.util.JsseSSLManager: class org.apache.jmeter.util.keystore.JmeterKeyStore 
2020/09/23 13:32:15 INFO  - jmeter.util.SSLManager: TrustStore Location: D:/apache-jmeter-2.11/test_truststore.jks 
2020/09/23 13:32:15 INFO  - jmeter.util.SSLManager: TrustStore created OK, Type: JKS 
2020/09/23 13:32:15 INFO  - jmeter.util.SSLManager: Truststore loaded OK from file
新的例外情况:

java.net.SocketException: Connection reset
    at java.net.SocketInputStream.read(Unknown Source)
    at java.net.SocketInputStream.read(Unknown Source)
    at sun.security.ssl.InputRecord.readFully(Unknown Source)
    at sun.security.ssl.InputRecord.readV3Record(Unknown Source)
    at sun.security.ssl.InputRecord.read(Unknown Source)
    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 org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:436)
    at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
    at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:294)
    at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:643)
    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:479)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
    at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(HTTPHC4Impl.java:481)
    at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:298)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1105)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1094)
    at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:429)
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:257)
    at java.lang.Thread.run(Unknown Source)
按照以下步骤操作,但仍然获得套接字异常:

In user.properties file:

httpclient4.retrycount=1
hc.parameters.file=hc.parameters

In hc.parameters file:

http.connection.stalecheck$Boolean=true

通过将下一行添加到

然后看看,很可能你会从中找出失败的确切原因

盲目射击:失败的原因可能是因为您使用的是8年前的JMeter版本,它运行在10年前的JDK之上,而jre/lib/security/cacerts下的一些版本已经过期


您应该总是使用JMT的最新版本,所以考虑升级到(或者是在页面中可以找到的最新的稳定版本)和最新的稳定的64位服务器JRE或JDK从网站(最小支持的一个在JME发行说明中提到)


设置此选项对我有效。

请参阅@user7294900证书尚未过期感谢响应。我已经用调试日志更新了任务。例外情况显示“未找到钥匙”。有什么想法吗?
test\u truststore.jks
不是JMeter附带的东西,如果您正在测试需要客户端身份验证的端点,则需要将证书添加到此
test\u truststore.jks
文件中。如果不这样做,只需从system.properties文件中删除对它的任何引用。更多信息:由于我们有服务器证书,所以不需要密钥库设置。我已经更新了这个问题,我在日志中没有看到任何错误,但是现在得到了新的异常。你能分享你的观点吗?拥有一个旧的信任库(在旧的JDK中,根已过期或根本不存在)不会导致“连接重置”;这将导致一个完全不同的例外。更可能的情况是,免费j7最多可实现TLS 1.2,但默认情况下,客户端最多只能提供TLS 1.0(在JSSE中命名为TLSv1),并且许多使用TLS和HTTPS进行安全保护的服务器不再允许TLS 1.0,因为它不再被认为是安全的。(例如,支付卡标准PCI DSS禁止使用它。)(注:绝对不要尝试使用SSLv3;自2014年以来,SSLv3已完全失效,没有人允许使用。请参阅中的POODLE。)
javax.net.debug=ssl