Top Description Fields Constructors Methods
org.apache.hc.core5.http.nio.ssl

public Class BasicServerTlsStrategy

extends Object
implements TlsStrategy
Class Inheritance
All Implemented Interfaces
org.apache.hc.core5.http.nio.ssl.TlsStrategy
Imports
java.net.SocketAddress, javax.net.ssl.SSLContext, org.apache.hc.core5.concurrent.FutureCallback, org.apache.hc.core5.http.HttpHost, org.apache.hc.core5.net.NamedEndpoint, org.apache.hc.core5.reactor.ssl.SSLBufferMode, .SSLSessionInitializer, .SSLSessionVerifier, .TransportSecurityLayer, org.apache.hc.core5.ssl.SSLContexts, org.apache.hc.core5.util.Args, .Timeout

Basic side-side implementation of TlsStrategy that upgrades to TLS for endpoints with the specified local ports.
Since
5.0

Field Summary

Modifier and TypeField and Description
private final SSLSessionInitializer
private final SecurePortStrategy
securePortStrategy

Deprecated as a consequence of SecurePortStrategy being deprecated.
private final SSLBufferMode
private final SSLContext
private final SSLSessionVerifier

Constructor Summary

AccessConstructor and Description
public
public
public
public
public
public
BasicServerTlsStrategy(final SSLSessionVerifier
the custom SSLSessionVerifier.
verifier
)

Constructor with the default SSL context based on system properties and custom SSLSessionVerifier verifier.

public
BasicServerTlsStrategy(final SSLContext sslContext, final SSLBufferMode sslBufferMode, final SSLSessionInitializer initializer, final SSLSessionVerifier verifier)

public
BasicServerTlsStrategy(final SSLContext sslContext, final SSLSessionInitializer initializer, final SSLSessionVerifier verifier)

public
BasicServerTlsStrategy(final SSLContext sslContext, final SSLSessionVerifier verifier)

public
public

Method Summary

Modifier and TypeMethod and Description
private boolean
isApplicable(final SocketAddress localAddress)

public void
upgrade(final TransportSecurityLayer
the session layer
tlsSession
,
final NamedEndpoint
the name of the opposite endpoint when applicable or null otherwise.
endpoint
,
final Object
arbitrary object passes to the TLS session initialization code.
attachment
,
final Timeout
the timeout to use while performing the TLS handshake; may be null.
handshakeTimeout
,
final FutureCallback<TransportSecurityLayer>
Operation result callback.
callback
)

Overrides default org.apache.hc.core5.http.nio.ssl.TlsStrategy.upgrade.

Secures current session layer with TLS.
public boolean
upgrade(final TransportSecurityLayer
the session layer
tlsSession
,
final HttpHost
the name of the opposite endpoint when given or null otherwise.
host
,
final SocketAddress
the address of the local endpoint.
localAddress
,
final SocketAddress
the address of the remote endpoint.
remoteAddress
,
final Object
arbitrary object passes to the TLS session initialization code.
attachment
,
final Timeout
the timeout to use while performing the TLS handshake; may be null.
handshakeTimeout
)

Implements org.apache.hc.core5.http.nio.ssl.TlsStrategy.upgrade.

Secures current session layer with TLS.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

initializerback to summary
private final SSLSessionInitializer initializer
securePortStrategyback to summary
private final SecurePortStrategy securePortStrategy

Deprecated

as a consequence of SecurePortStrategy being deprecated. See corresponding docs for further information.

Annotations
@SuppressWarnings:deprecation
sslBufferModeback to summary
private final SSLBufferMode sslBufferMode
sslContextback to summary
private final SSLContext sslContext
verifierback to summary
private final SSLSessionVerifier verifier

Constructor Detail

BasicServerTlsStrategyback to summary
public BasicServerTlsStrategy(final SSLContext sslContext, final SecurePortStrategy securePortStrategy, final SSLBufferMode sslBufferMode, final SSLSessionInitializer initializer, final SSLSessionVerifier verifier)
Annotations
@Deprecated
BasicServerTlsStrategyback to summary
public BasicServerTlsStrategy(final SSLContext sslContext, final SecurePortStrategy securePortStrategy, final SSLSessionInitializer initializer, final SSLSessionVerifier verifier)
Annotations
@Deprecated
BasicServerTlsStrategyback to summary
public BasicServerTlsStrategy(final SSLContext sslContext, final SecurePortStrategy securePortStrategy, final SSLSessionVerifier verifier)
Annotations
@Deprecated
BasicServerTlsStrategyback to summary
public BasicServerTlsStrategy(final SSLContext sslContext, final SecurePortStrategy securePortStrategy)
Annotations
@Deprecated
BasicServerTlsStrategyback to summary
public BasicServerTlsStrategy(final SecurePortStrategy securePortStrategy)
Annotations
@Deprecated
BasicServerTlsStrategyback to summary
public BasicServerTlsStrategy(final SSLSessionVerifier verifier)

Constructor with the default SSL context based on system properties and custom SSLSessionVerifier verifier.

Parameters
verifier:SSLSessionVerifier

the custom SSLSessionVerifier.

Since
5.2
BasicServerTlsStrategyback to summary
public BasicServerTlsStrategy(final SSLContext sslContext, final SSLBufferMode sslBufferMode, final SSLSessionInitializer initializer, final SSLSessionVerifier verifier)
BasicServerTlsStrategyback to summary
public BasicServerTlsStrategy(final SSLContext sslContext, final SSLSessionInitializer initializer, final SSLSessionVerifier verifier)
BasicServerTlsStrategyback to summary
public BasicServerTlsStrategy(final SSLContext sslContext, final SSLSessionVerifier verifier)
BasicServerTlsStrategyback to summary
public BasicServerTlsStrategy(final SSLContext sslContext)
BasicServerTlsStrategyback to summary
public BasicServerTlsStrategy()

Method Detail

isApplicableback to summary
private boolean isApplicable(final SocketAddress localAddress)
upgradeback to summary
public void upgrade(final TransportSecurityLayer tlsSession, final NamedEndpoint endpoint, final Object attachment, final Timeout handshakeTimeout, final FutureCallback<TransportSecurityLayer> callback)

Overrides default org.apache.hc.core5.http.nio.ssl.TlsStrategy.upgrade.

Doc from org.apache.hc.core5.http.nio.ssl.TlsStrategy.upgrade.

Secures current session layer with TLS.

Parameters
tlsSession:TransportSecurityLayer

the session layer

endpoint:NamedEndpoint

the name of the opposite endpoint when applicable or null otherwise.

attachment:Object

arbitrary object passes to the TLS session initialization code.

handshakeTimeout:Timeout

the timeout to use while performing the TLS handshake; may be null.

callback:FutureCallback<TransportSecurityLayer>

Operation result callback.

Annotations
@Override
upgradeback to summary
public boolean upgrade(final TransportSecurityLayer tlsSession, final HttpHost host, final SocketAddress localAddress, final SocketAddress remoteAddress, final Object attachment, final Timeout handshakeTimeout)

Implements org.apache.hc.core5.http.nio.ssl.TlsStrategy.upgrade.

Doc from org.apache.hc.core5.http.nio.ssl.TlsStrategy.upgrade.

Secures current session layer with TLS.

Parameters
tlsSession:TransportSecurityLayer

the session layer

host:HttpHost

the name of the opposite endpoint when given or null otherwise.

localAddress:SocketAddress

the address of the local endpoint.

remoteAddress:SocketAddress

the address of the remote endpoint.

attachment:Object

arbitrary object passes to the TLS session initialization code.

handshakeTimeout:Timeout

the timeout to use while performing the TLS handshake; may be null.

Returns:boolean

true if the session has been upgraded, false otherwise.

Annotations
@Deprecated
@Override