Package org.apache.hc.core5.http2.ssl
Class H2ClientTlsStrategy
java.lang.Object
org.apache.hc.core5.http2.ssl.H2ClientTlsStrategy
- All Implemented Interfaces:
TlsStrategy
Basic client-side implementation of
TlsStrategy
that upgrades to TLS for all endpoints
with HTTPS
scheme.- Since:
- 5.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final SSLSessionInitializer
private final SSLBufferMode
private final SSLContext
private final SSLSessionVerifier
-
Constructor Summary
ConstructorsConstructorDescriptionH2ClientTlsStrategy
(SSLContext sslContext) H2ClientTlsStrategy
(SSLContext sslContext, SSLBufferMode sslBufferMode, SSLSessionInitializer initializer, SSLSessionVerifier verifier) H2ClientTlsStrategy
(SSLContext sslContext, SSLSessionInitializer initializer, SSLSessionVerifier verifier) H2ClientTlsStrategy
(SSLContext sslContext, SSLSessionVerifier verifier) H2ClientTlsStrategy
(SSLSessionVerifier verifier) Constructor with the default SSL context based on system properties and customSSLSessionVerifier
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
upgrade
(TransportSecurityLayer tlsSession, HttpHost host, SocketAddress localAddress, SocketAddress remoteAddress, Object attachment, Timeout handshakeTimeout) Deprecated.void
upgrade
(TransportSecurityLayer tlsSession, NamedEndpoint endpoint, Object attachment, Timeout handshakeTimeout, FutureCallback<TransportSecurityLayer> callback) Secures current session layer with TLS.
-
Field Details
-
sslContext
-
sslBufferMode
-
initializer
-
verifier
-
-
Constructor Details
-
H2ClientTlsStrategy
public H2ClientTlsStrategy(SSLContext sslContext, SSLBufferMode sslBufferMode, SSLSessionInitializer initializer, SSLSessionVerifier verifier) -
H2ClientTlsStrategy
public H2ClientTlsStrategy(SSLContext sslContext, SSLSessionInitializer initializer, SSLSessionVerifier verifier) -
H2ClientTlsStrategy
-
H2ClientTlsStrategy
-
H2ClientTlsStrategy
public H2ClientTlsStrategy() -
H2ClientTlsStrategy
Constructor with the default SSL context based on system properties and customSSLSessionVerifier
.- Parameters:
verifier
- the customSSLSessionVerifier
.- Since:
- 5.2
- See Also:
-
-
Method Details
-
upgrade
public void upgrade(TransportSecurityLayer tlsSession, NamedEndpoint endpoint, Object attachment, Timeout handshakeTimeout, FutureCallback<TransportSecurityLayer> callback) Description copied from interface:TlsStrategy
Secures current session layer with TLS.- Specified by:
upgrade
in interfaceTlsStrategy
- Parameters:
tlsSession
- the session layerendpoint
- the name of the opposite endpoint when applicable ornull
otherwise.attachment
- arbitrary object passes to the TLS session initialization code.handshakeTimeout
- the timeout to use while performing the TLS handshake; may benull
.callback
- Operation result callback.
-
upgrade
@Deprecated public boolean upgrade(TransportSecurityLayer tlsSession, HttpHost host, SocketAddress localAddress, SocketAddress remoteAddress, Object attachment, Timeout handshakeTimeout) Description copied from interface:TlsStrategy
Secures current session layer with TLS.- Specified by:
upgrade
in interfaceTlsStrategy
- Parameters:
tlsSession
- the session layerhost
- the name of the opposite endpoint when given ornull
otherwise.localAddress
- the address of the local endpoint.remoteAddress
- the address of the remote endpoint.attachment
- arbitrary object passes to the TLS session initialization code.handshakeTimeout
- the timeout to use while performing the TLS handshake; may benull
.- Returns:
true
if the session has been upgraded,false
otherwise.
-
upgrade(TransportSecurityLayer, NamedEndpoint, Object, Timeout, FutureCallback)