HTTPCLIENT-789: Support for passing an SSLContext to the SSLSocketFactory
Contributed by Bruno Harbulot <Bruno.Harbulot at manchester.ac.uk> git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@684578 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
43c53f2ecf
commit
1f7f493c18
|
@ -216,6 +216,20 @@ public class SSLSocketFactory implements LayeredSocketFactory {
|
|||
this(TLS, null, null, truststore, null, null);
|
||||
}
|
||||
|
||||
public SSLSocketFactory(
|
||||
final SSLContext sslContext,
|
||||
final HostNameResolver nameResolver)
|
||||
{
|
||||
this.sslcontext = sslContext;
|
||||
this.socketfactory = this.sslcontext.getSocketFactory();
|
||||
this.nameResolver = nameResolver;
|
||||
}
|
||||
|
||||
public SSLSocketFactory(final SSLContext sslContext)
|
||||
{
|
||||
this(sslContext, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the default SSL socket factory.
|
||||
* This constructor is used exclusively to instantiate the factory for
|
||||
|
|
Loading…
Reference in New Issue