情绪不高 2021-04-27 02:57 采纳率: 0%
浏览 1336

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请求:

展开全部

  • 写回答

4条回答 默认 最新

  • 关注
    评论
  • 有问必答小助手 2021-04-27 10:45
    关注

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

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

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

    评论
  • 有问必答小助手 2021-04-28 09:29
    关注

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

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

    评论
  • 鄙人跳大神 2022-06-26 09:10
    关注

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

    评论
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部