Package org.apache.hc.client5.http.ssl
Class DefaultClientTlsStrategy
java.lang.Object
org.apache.hc.client5.http.ssl.DefaultClientTlsStrategy
- All Implemented Interfaces:
TlsSocketStrategy,org.apache.hc.core5.http.nio.ssl.TlsStrategy
- Direct Known Subclasses:
SpkiPinningClientTlsStrategy
TLS upgrade strategy for non-blocking client connections.
- Since:
- 5.0
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultClientTlsStrategy(SSLContext sslContext) DefaultClientTlsStrategy(SSLContext sslContext, String[] supportedProtocols, String[] supportedCipherSuites, org.apache.hc.core5.reactor.ssl.SSLBufferMode sslBufferManagement, HostnameVerifier hostnameVerifier) DefaultClientTlsStrategy(SSLContext sslContext, String[] supportedProtocols, String[] supportedCipherSuites, org.apache.hc.core5.reactor.ssl.SSLBufferMode sslBufferManagement, HostnameVerifier hostnameVerifier, org.apache.hc.core5.function.Factory<SSLEngine, org.apache.hc.core5.reactor.ssl.TlsDetails> tlsDetailsFactory) Deprecated.DefaultClientTlsStrategy(SSLContext sslContext, String[] supportedProtocols, String[] supportedCipherSuites, org.apache.hc.core5.reactor.ssl.SSLBufferMode sslBufferManagement, HostnameVerificationPolicy hostnameVerificationPolicy, HostnameVerifier hostnameVerifier) DefaultClientTlsStrategy(SSLContext sslContext, HostnameVerifier hostnameVerifier) DefaultClientTlsStrategy(SSLContext sslContext, HostnameVerificationPolicy hostnameVerificationPolicy, HostnameVerifier hostnameVerifier) -
Method Summary
Modifier and TypeMethodDescriptionstatic DefaultClientTlsStrategystatic DefaultClientTlsStrategystatic org.apache.hc.core5.http.nio.ssl.TlsStrategyDeprecated.UsecreateDefault().static org.apache.hc.core5.http.nio.ssl.TlsStrategyDeprecated.protected voidinitializeEngine(SSLEngine sslEngine) protected voidinitializeSocket(SSLSocket socket) upgrade(Socket socket, String target, int port, Object attachment, org.apache.hc.core5.http.protocol.HttpContext context) Upgrades the given plain socket and executes the TLS handshake over it.booleanupgrade(org.apache.hc.core5.reactor.ssl.TransportSecurityLayer tlsSession, org.apache.hc.core5.http.HttpHost host, SocketAddress localAddress, SocketAddress remoteAddress, Object attachment, org.apache.hc.core5.util.Timeout handshakeTimeout) Deprecated.useTlsStrategy.upgrade(TransportSecurityLayer, NamedEndpoint, Object, Timeout, FutureCallback)voidupgrade(org.apache.hc.core5.reactor.ssl.TransportSecurityLayer tlsSession, org.apache.hc.core5.net.NamedEndpoint endpoint, Object attachment, org.apache.hc.core5.util.Timeout handshakeTimeout, org.apache.hc.core5.concurrent.FutureCallback<org.apache.hc.core5.reactor.ssl.TransportSecurityLayer> callback) protected voidverifySession(String hostname, SSLSession sslsession)
-
Constructor Details
-
DefaultClientTlsStrategy
@Deprecated public DefaultClientTlsStrategy(SSLContext sslContext, String[] supportedProtocols, String[] supportedCipherSuites, org.apache.hc.core5.reactor.ssl.SSLBufferMode sslBufferManagement, HostnameVerifier hostnameVerifier, org.apache.hc.core5.function.Factory<SSLEngine, org.apache.hc.core5.reactor.ssl.TlsDetails> tlsDetailsFactory) -
DefaultClientTlsStrategy
public DefaultClientTlsStrategy(SSLContext sslContext, String[] supportedProtocols, String[] supportedCipherSuites, org.apache.hc.core5.reactor.ssl.SSLBufferMode sslBufferManagement, HostnameVerificationPolicy hostnameVerificationPolicy, HostnameVerifier hostnameVerifier) - Since:
- 5.4
-
DefaultClientTlsStrategy
public DefaultClientTlsStrategy(SSLContext sslContext, String[] supportedProtocols, String[] supportedCipherSuites, org.apache.hc.core5.reactor.ssl.SSLBufferMode sslBufferManagement, HostnameVerifier hostnameVerifier) -
DefaultClientTlsStrategy
-
DefaultClientTlsStrategy
public DefaultClientTlsStrategy(SSLContext sslContext, HostnameVerificationPolicy hostnameVerificationPolicy, HostnameVerifier hostnameVerifier) - Since:
- 5.4
-
DefaultClientTlsStrategy
-
-
Method Details
-
createDefault
- Since:
- 5.4
-
createSystemDefault
- Since:
- 5.4
-
getDefault
Deprecated.UsecreateDefault(). -
getSystemDefault
Deprecated. -
upgrade
@Deprecated public boolean upgrade(org.apache.hc.core5.reactor.ssl.TransportSecurityLayer tlsSession, org.apache.hc.core5.http.HttpHost host, SocketAddress localAddress, SocketAddress remoteAddress, Object attachment, org.apache.hc.core5.util.Timeout handshakeTimeout) Deprecated.useTlsStrategy.upgrade(TransportSecurityLayer, NamedEndpoint, Object, Timeout, FutureCallback)- Specified by:
upgradein interfaceorg.apache.hc.core5.http.nio.ssl.TlsStrategy
-
upgrade
public void upgrade(org.apache.hc.core5.reactor.ssl.TransportSecurityLayer tlsSession, org.apache.hc.core5.net.NamedEndpoint endpoint, Object attachment, org.apache.hc.core5.util.Timeout handshakeTimeout, org.apache.hc.core5.concurrent.FutureCallback<org.apache.hc.core5.reactor.ssl.TransportSecurityLayer> callback) - Specified by:
upgradein interfaceorg.apache.hc.core5.http.nio.ssl.TlsStrategy
-
initializeEngine
-
initializeSocket
-
verifySession
- Throws:
SSLException
-
upgrade
public SSLSocket upgrade(Socket socket, String target, int port, Object attachment, org.apache.hc.core5.http.protocol.HttpContext context) throws IOException Description copied from interface:TlsSocketStrategyUpgrades the given plain socket and executes the TLS handshake over it.- Specified by:
upgradein interfaceTlsSocketStrategy- Parameters:
socket- the existing plain sockettarget- the name of the target host.port- the port to connect to on the target host.attachment- connect request attachment.context- the actual HTTP context.- Returns:
- socket upgraded to TLS.
- Throws:
IOException
-
DefaultClientTlsStrategy(SSLContext, String[], String[], SSLBufferMode, HostnameVerifier)