javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection? HTTPS请求异常

在Jmeter中压测https接口,请求抛出异常

javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
	at sun.security.ssl.InputRecord.handleUnknownRecord(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.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:404)
	at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:364)
	at org.apache.jmeter.protocol.http.sampler.hc.LazyLayeredConnectionSocketFactory.connectSocket(LazyLayeredConnectionSocketFactory.java:92)

在服务器上用curl命令测试http接口,不报错

curl http://127.0.0.1:80/prepare/queryClassTypeById.do?sysChId=20180808150810949693989647340

在服务器上用curl命令测试https接口,提示:

[root@localhost logs]# curl -k https://127.0.0.1:80/prepare/queryClassTypeById.do?sysChId=20180808150810949693989647340
curl: (35) SSL connect error

得出结论 Unrecognized SSL message, plaintext connection?的异常是因为对方提供的不是https服务的端口

详见:https://blog.csdn.net/dtlscsl/article/details/50462721

你可能感兴趣的:(Jmeter)