JMeter连接https接口报错,SSLHandshakeException

版本:

JMeter5.4.1

jdk1.8

报错信息:

Response code:Non HTTP response code: javax.net.ssl.SSLHandshakeException
Response message:Non HTTP response message: Remote host terminated the handshake

响应结果:

javax.net.ssl.SSLHandshakeException: Remote host terminated the handshake
    at sun.security.ssl.SSLSocketImpl.handleEOF(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.decode(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.readHandshakeRecord(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.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(Unknown Source)
    at org.apache.jmeter.protocol.http.sampler.HTTPJavaImpl.sample(HTTPJavaImpl.java:536)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:66)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1296)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1285)
    at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:638)
    at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:558)
    at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:489)
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.io.EOFException: SSL peer shut down incorrectly
    at sun.security.ssl.SSLSocketInputRecord.read(Unknown Source)
    at sun.security.ssl.SSLSocketInputRecord.readHeader(Unknown Source)
    at sun.security.ssl.SSLSocketInputRecord.decode(Unknown Source)
    at sun.security.ssl.SSLTransport.decode(Unknown Source)
    ... 16 more

尝试过的方法:

1. 检查环境变量,配置是正确的

2. 检查协议、地址,是对的

3. 下载了访问的https接口的SSL证书.cer,用keytool转换成.store证书,也导入了JMeter

4. HTTP请求去掉勾use keepalive,advanced里设置implementation为httpclient4,connect为60,报错变成ConnectTimeoutException

根本原因还是因为第一次握手就被服务端拒了

如果有遇到类似情况的亲,还请不吝赐教~

下图是HTTP请求:

参考:https://blog.csdn.net/ajiatutu/article/details/79569756

您好,我是有问必答小助手,你的问题已经有小伙伴为您解答了问题,您看下是否解决了您的问题,可以追评进行沟通哦~

如果有您比较满意的答案 / 帮您提供解决思路的答案,可以点击【采纳】按钮,给回答的小伙伴一些鼓励哦~~

ps:问答VIP仅需29元,即可享受5次/月 有问必答服务,了解详情>>>https://vip.csdn.net/askvip?utm_source=1146287632

非常感谢您使用有问必答服务,为了后续更快速的帮您解决问题,现诚邀您参与有问必答体验反馈。您的建议将会运用到我们的产品优化中,希望能得到您的支持与协助!

速戳参与调研>>>https://t.csdnimg.cn/Kf0y

请问你这个问题解决了吗 我也遇到了相同的问题