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:
Oleg Kalnichevski 2008-08-10 19:35:36 +00:00
parent 43c53f2ecf
commit 1f7f493c18
1 changed files with 14 additions and 0 deletions

View File

@ -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