java Jmeter 侦听器显示“javax.net.ssl.SSLException:无法识别的 SSL 消息,纯文本连接?”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10736621/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-31 02:18:52  来源:igfitidea点击:

Jmeter listener showing " javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?"

javajmeter

提问by Mandy

Using jmeter I am trying to run a test that was recorded using HTTP proxy Server. But on playing the test following exception is thrown in the listener.

使用 jmeter 我试图运行一个使用 HTTP 代理服务器记录的测试。但是在播放测试时,侦听器中会抛出以下异常。

javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
    at com.sun.net.ssl.internal.ssl.InputRecord.handleUnknownRecord(InputRecord.java:521)
    at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:355)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:722)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1029)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1056)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1040)
    at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:405)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:170)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:133)
    at org.apache.jmeter.protocol.http.sampler.HTTPSampler.sample(HTTPSampler.java:483)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:965)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:951)
    at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:348)
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:243)
    at java.lang.Thread.run(Thread.java:619)

The website also had certificate issue for which i permanently stored exception.What can be the reasons for this error? Any help would be appreciated

该网站也有证书问题,我永久存储了异常。此错误的原因是什么?任何帮助,将不胜感激

回答by Robert

The error message indicates that you are trying to establish an SSL/TLS connection using a port on the server that speaks HTTP and not HTTPs. Make sure you have the correct port - usually 443 for HTTPS.

该错误消息表明您正在尝试使用服务器上使用 HTTP 而不是 HTTPS 的端口建立 SSL/TLS 连接。确保您拥有正确的端口——HTTPS 通常为 443。