jmeter 3.0 的readme里有这样一句话:
Apache JMeter interfaces with the
Java Secure Socket Extension (JSSE) API to provide
- HTTPS support
于是查看了jmeter源码,想看看jmeter是如何对https做支持的。
首先从 org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl类入手:
重点关注sample方法,截取代码如下:
public class HTTPHC4Impl extends HTTPHCAbstractImpl {
@Override
protected HTTPSampleResult sample(URL url, String method,
boolean areFollowingRedirect, int frameDepth) {
//...
HttpClient httpClient = setupClient(url, res);
}
private HttpClient setupClient(URL url, SampleResult res) {
//...
MeasuringConnectionManager connManager =