Bug 59902 - Https handshake failure when setting httpclient.socket.https.cps property
Summary: Https handshake failure when setting httpclient.socket.https.cps property
Status: RESOLVED FIXED
Alias: None
Product: JMeter
Classification: Unclassified
Component: HTTP (show other bugs)
Version: 3.0
Hardware: All All
: P1 major (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-26 10:03 UTC by Jerome
Modified: 2016-07-31 20:08 UTC (History)
1 user (show)



Attachments
JMX to reproduce the issue (4.71 KB, application/xml)
2016-07-26 10:03 UTC, Jerome
Details

Note You need to log in before you can comment on or make changes to this bug.
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