Fixes #4177 - Configure HTTP proxy with SslContextFactory.

Updates after review.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
Simone Bordet 2019-10-10 10:00:17 +02:00
parent c8175ec107
commit a73568df28
1 changed files with 14 additions and 1 deletions

View File

@ -1160,10 +1160,23 @@ public class HttpClient extends ContainerLifeCycle
return HttpScheme.HTTPS.is(scheme) || HttpScheme.WSS.is(scheme); return HttpScheme.HTTPS.is(scheme) || HttpScheme.WSS.is(scheme);
} }
/**
* Creates a new {@code SslClientConnectionFactory} wrapping the given connection factory.
*
* @param connectionFactory the connection factory to wrap
* @return a new SslClientConnectionFactory
* @deprecated use {@link #newSslClientConnectionFactory(SslContextFactory, ClientConnectionFactory)} instead
*/
@Deprecated
protected ClientConnectionFactory newSslClientConnectionFactory(ClientConnectionFactory connectionFactory)
{
return new SslClientConnectionFactory(getSslContextFactory(), getByteBufferPool(), getExecutor(), connectionFactory);
}
protected ClientConnectionFactory newSslClientConnectionFactory(SslContextFactory sslContextFactory, ClientConnectionFactory connectionFactory) protected ClientConnectionFactory newSslClientConnectionFactory(SslContextFactory sslContextFactory, ClientConnectionFactory connectionFactory)
{ {
if (sslContextFactory == null) if (sslContextFactory == null)
sslContextFactory = getSslContextFactory(); return newSslClientConnectionFactory(connectionFactory);
return new SslClientConnectionFactory(sslContextFactory, getByteBufferPool(), getExecutor(), connectionFactory); return new SslClientConnectionFactory(sslContextFactory, getByteBufferPool(), getExecutor(), connectionFactory);
} }