Package org.apache.hc.core5.http.nio.ssl
Class BasicServerTlsStrategy
- java.lang.Object
-
- org.apache.hc.core5.http.nio.ssl.BasicServerTlsStrategy
-
- All Implemented Interfaces:
TlsStrategy
public class BasicServerTlsStrategy extends java.lang.Object implements TlsStrategy
Basic server-side implementation ofTlsStrategythat upgrades inbound connection with TLS security but does not make use of TLS ALPN extension to negotiate an application protocol. This strategy will also automatically enforce restrictions on TLS parameters by excluding TLS versions and ciphers considered weak.This strategy should not be used unless no TLS ALPN support is actually desired. One is advised to use a custom
TlsStrategyimplementation or an implementation provided by the HTTP/2 module.- Since:
- 5.0
-
-
Field Summary
Fields Modifier and Type Field Description private SSLSessionInitializerinitializerprivate SecurePortStrategysecurePortStrategyprivate SSLBufferModesslBufferModeprivate javax.net.ssl.SSLContextsslContextprivate SSLSessionVerifierverifier
-
Constructor Summary
Constructors Constructor Description BasicServerTlsStrategy()BasicServerTlsStrategy(javax.net.ssl.SSLContext sslContext)BasicServerTlsStrategy(javax.net.ssl.SSLContext sslContext, SecurePortStrategy securePortStrategy)Deprecated.BasicServerTlsStrategy(javax.net.ssl.SSLContext sslContext, SecurePortStrategy securePortStrategy, SSLBufferMode sslBufferMode, SSLSessionInitializer initializer, SSLSessionVerifier verifier)BasicServerTlsStrategy(javax.net.ssl.SSLContext sslContext, SecurePortStrategy securePortStrategy, SSLSessionInitializer initializer, SSLSessionVerifier verifier)BasicServerTlsStrategy(javax.net.ssl.SSLContext sslContext, SecurePortStrategy securePortStrategy, SSLSessionVerifier verifier)Deprecated.BasicServerTlsStrategy(javax.net.ssl.SSLContext sslContext, SSLBufferMode sslBufferMode, SSLSessionInitializer initializer, SSLSessionVerifier verifier)BasicServerTlsStrategy(javax.net.ssl.SSLContext sslContext, SSLSessionInitializer initializer, SSLSessionVerifier verifier)BasicServerTlsStrategy(javax.net.ssl.SSLContext sslContext, SSLSessionVerifier verifier)BasicServerTlsStrategy(SecurePortStrategy securePortStrategy)Deprecated.BasicServerTlsStrategy(SSLSessionVerifier verifier)Constructor with the default SSL context based on system properties and customSSLSessionVerifierverifier.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description private booleanisApplicable(java.net.SocketAddress localAddress)booleanupgrade(TransportSecurityLayer tlsSession, HttpHost host, java.net.SocketAddress localAddress, java.net.SocketAddress remoteAddress, java.lang.Object attachment, Timeout handshakeTimeout)voidupgrade(TransportSecurityLayer tlsSession, NamedEndpoint endpoint, java.lang.Object attachment, Timeout handshakeTimeout, FutureCallback<TransportSecurityLayer> callback)Secures current session layer with TLS.
-
-
-
Field Detail
-
sslContext
private final javax.net.ssl.SSLContext sslContext
-
securePortStrategy
private final SecurePortStrategy securePortStrategy
-
sslBufferMode
private final SSLBufferMode sslBufferMode
-
initializer
private final SSLSessionInitializer initializer
-
verifier
private final SSLSessionVerifier verifier
-
-
Constructor Detail
-
BasicServerTlsStrategy
@Deprecated public BasicServerTlsStrategy(javax.net.ssl.SSLContext sslContext, SecurePortStrategy securePortStrategy, SSLBufferMode sslBufferMode, SSLSessionInitializer initializer, SSLSessionVerifier verifier)
-
BasicServerTlsStrategy
@Deprecated public BasicServerTlsStrategy(javax.net.ssl.SSLContext sslContext, SecurePortStrategy securePortStrategy, SSLSessionInitializer initializer, SSLSessionVerifier verifier)
-
BasicServerTlsStrategy
@Deprecated public BasicServerTlsStrategy(javax.net.ssl.SSLContext sslContext, SecurePortStrategy securePortStrategy, SSLSessionVerifier verifier)Deprecated.
-
BasicServerTlsStrategy
@Deprecated public BasicServerTlsStrategy(javax.net.ssl.SSLContext sslContext, SecurePortStrategy securePortStrategy)Deprecated.
-
BasicServerTlsStrategy
@Deprecated public BasicServerTlsStrategy(SecurePortStrategy securePortStrategy)
Deprecated.
-
BasicServerTlsStrategy
public BasicServerTlsStrategy(SSLSessionVerifier verifier)
Constructor with the default SSL context based on system properties and customSSLSessionVerifierverifier.- Parameters:
verifier- the customSSLSessionVerifier.- Since:
- 5.2
-
BasicServerTlsStrategy
public BasicServerTlsStrategy(javax.net.ssl.SSLContext sslContext, SSLBufferMode sslBufferMode, SSLSessionInitializer initializer, SSLSessionVerifier verifier)
-
BasicServerTlsStrategy
public BasicServerTlsStrategy(javax.net.ssl.SSLContext sslContext, SSLSessionInitializer initializer, SSLSessionVerifier verifier)
-
BasicServerTlsStrategy
public BasicServerTlsStrategy(javax.net.ssl.SSLContext sslContext, SSLSessionVerifier verifier)
-
BasicServerTlsStrategy
public BasicServerTlsStrategy(javax.net.ssl.SSLContext sslContext)
-
BasicServerTlsStrategy
public BasicServerTlsStrategy()
-
-
Method Detail
-
isApplicable
private boolean isApplicable(java.net.SocketAddress localAddress)
-
upgrade
public void upgrade(TransportSecurityLayer tlsSession, NamedEndpoint endpoint, java.lang.Object attachment, Timeout handshakeTimeout, FutureCallback<TransportSecurityLayer> callback)
Description copied from interface:TlsStrategySecures current session layer with TLS.- Specified by:
upgradein interfaceTlsStrategy- Parameters:
tlsSession- the session layerendpoint- the name of the opposite endpoint when applicable ornullotherwise.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, java.net.SocketAddress localAddress, java.net.SocketAddress remoteAddress, java.lang.Object attachment, Timeout handshakeTimeout)
Description copied from interface:TlsStrategySecures current session layer with TLS.- Specified by:
upgradein interfaceTlsStrategy- Parameters:
tlsSession- the session layerhost- the name of the opposite endpoint when given ornullotherwise.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:
trueif the session has been upgraded,falseotherwise.
-
-