Bug 59902

Summary: Https handshake failure when setting httpclient.socket.https.cps property
Product: JMeter Reporter: Jerome <loisel.jerome>
Component: HTTPAssignee: JMeter issues mailing list <issues>
Status: RESOLVED FIXED    
Severity: major CC: p.mouawad
Priority: P1    
Version: 3.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: JMX to reproduce the issue

Description Jerome 2016-07-26 10:03:32 UTC
Created attachment 34072 [details]
JMX to reproduce the issue

The recent upgrade to HttpClient 4.5.2 solved handshake failure issue by introducing support for HTTPS SNI certificates. Unfortunately, it breaks again when enabling HTTPS bandwidth limitation.

Steps to reproduce:
1. Edit bin/user.properties: add the following line:
httpclient.socket.https.cps=1280000
2. Run the attached JMX,
3. The Https request fails with the following stack:

javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
	at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
	at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)
	at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:2023)
	at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1125)
	at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)
	at org.apache.jmeter.util.SlowSSLSocket.startHandshake(SlowSSLSocket.java:160)
	at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:553)
	at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:412)
	at org.apache.jmeter.protocol.http.sampler.LazySchemeSocketFactory.connectSocket(LazySchemeSocketFactory.java:97)
	at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:179)
	at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:328)
	at org.apache.jmeter.protocol.http.sampler.MeasuringConnectionManager$MeasuredConnection.open(MeasuringConnectionManager.java:114)
	at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:612)
	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:447)
	at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:884)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55)
	at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(HTTPHC4Impl.java:566)
	at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:326)
	at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74)
	at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1146)
	at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1135)
	at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:465)
	at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:410)
	at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:241)
	at java.lang.Thread.run(Thread.java:745)


When running exactly the same JMX without the cps property, it's working properly.
Comment 1 Philippe Mouawad 2016-07-31 20:08:47 UTC
Author: pmouawad
Date: Sun Jul 31 20:07:10 2016
New Revision: 1754681

URL: http://svn.apache.org/viewvc?rev=1754681&view=rev
Log:
Bug 59902 - Https handshake failure when setting httpclient.socket.https.cps property
Bugzilla Id: 59902

Added:
    jmeter/trunk/src/core/org/apache/jmeter/util/HostNameSetter.java   (with props)
Modified:
    jmeter/trunk/src/core/org/apache/jmeter/util/SlowSSLSocket.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/JMeterClientConnectionOperator.java
    jmeter/trunk/xdocs/changes.xml