简体   繁体   English

Jmeter 2.11:获取对等端未验证

[英]Jmeter 2.11 : Getting Peer Not Authenticated

I am getting the exception listed below:我收到下面列出的异常:

 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)

properties in Jmeter.properties: Jmeter.properties 中的属性:

> #https.default.protocol=TLS
> #https.default.protocol=SSLv3
> #https.socket.protocols=SSLv2Hello SSLv3 TLSv1

JDK version: 1.7 JDK版本:1.7

1.I have already imported the required certificates. 1.我已经导入了所需的证书。 2.I tried setting the https.socket.protocols=SSLv3 [https://bz.apache.org/bugzilla/show_bug.cgi?id=54759] 2.我尝试设置 https.socket.protocols=SSLv3 [https://bz.apache.org/bugzilla/show_bug.cgi?id=54759]
3.I have changed the implementation to HTTPClient4 4. The certificate's expiry year is 2022 3.我已将实现更改为 HTTPClient4 4. 证书的到期年份为 2022

but it didn't work.Please suggest solutions但它没有用。请提出解决方案

UPDATE:更新:

           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

New Exception:新例外:

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)

Followed these steps but still getting the socket exception:按照以下步骤操作但仍然出现套接字异常:

In user.properties file:

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

In hc.parameters file:

http.connection.stalecheck$Boolean=true

Enable debug logging for SSL by adding the next line to system.properties file通过将下一行添加到system.properties文件来为 SSL 启用调试日志记录

javax.net.debug=ssl

and then look at jmeter.log file and stdout , most probably you will figure out the exact reason for the failure from them.然后查看jmeter.log 文件stdout ,很可能您会从中找出失败的确切原因。

Blind shot: the reason of failure might be due to you're using 8 years old JMeter version which is running on top of 10 years old JDK and some essential security certificates which reside under jre/lib/security/cacerts has expired already.盲目拍摄:失败的原因可能是由于您使用的是 8 岁的 JMeter 版本,该版本运行在 10 岁的 JDK 之上,并且位于 jre/lib/security/cacerts 下的一些 基本安全证书已经过期。

As per JMeter Best Practices you should always be using the latest version of JMeter so consider upgrading to JMeter 5.3 (or whatever is the latest stable version you can find at JMeter Downloads page) and the latest stable version of 64-bit server JRE or JDK from OpenJDK website (the minimum supported one is mentioned in JMeter release notes)根据JMeter 最佳实践,您应该始终使用最新版本的 JMeter,因此请考虑升级到JMeter 5.3 (或者您可以在JMeter 下载页面找到的最新稳定版本)和 64 位服务器 JRE 或 JDK 的最新稳定版本来自OpenJDK网站(JMeter 发行说明中提到了最低支持的)

https.default.protocol=TLSv1.2 https.default.protocol=TLSv1.2

setting this worked for me.设置这对我有用。

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

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