Interface TlsConfig
- All Superinterfaces:
Prototype.Api, Prototype.Factory<Tls>, TlsMaterial
- All Known Implementing Classes:
TlsConfig.BuilderBase.TlsConfigImpl
TLS configuration, used by web server listeners, web client and other components that need TLS.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classFluent API builder forTls.static classTlsConfig.BuilderBase<BUILDER extends TlsConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends TlsConfig>Fluent API builder base forTlsConfig. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe default protocol is set to "TLS".static final intThe default session cache size as defined for unset value inSSLSessionContext.getSessionCacheSize().static final StringThe default session timeout as defined for unset value inSSLSessionContext.getSessionTimeout(). -
Method Summary
Modifier and TypeMethodDescriptionConfigure list of supported application protocols (such ash2) for application layer protocol negotiation (ALPN).static TlsConfig.Builderbuilder()Create a new fluent API builder to customize configuration.static TlsConfig.BuilderCreate a new fluent API builder from an existing instance.Configure requirement for mutual TLS.static TlsConfigcreate()Create a new instance with default values.static TlsConfigCreate a new instance from configuration.booleanenabled()Flag indicating whether Tls is enabled.Enabled cipher suites for TLS communication.Enabled protocols for TLS communication.Identification algorithm for SSL endpoints.manager()The configured TLS manager.protocol()Configure the protocol used to obtain an instance ofSSLContext.provider()Use explicit provider to obtain an instance ofSSLContext.intSSL session cache size.SSL session timeout.Provide a fully configuredSSLContext.Configure SSL parameters.Methods inherited from interface Prototype.Factory
buildMethods inherited from interface TlsMaterial
internalKeystoreProvider, internalKeystoreType, keyManagerFactoryAlgorithm, keyManagerFactoryProvider, privateKey, privateKeyCertChain, revocation, secureRandom, secureRandomAlgorithm, secureRandomProvider, trust, trustAll, trustManagerFactoryAlgorithm, trustManagerFactoryProviderModifier and TypeMethodDescriptionProvider of the key stores used internally to create a key and trust manager factories.Type of the key stores used internally to create a key and trust manager factories.Algorithm of the key manager factory used when private key is defined.Key manager factory provider.Private key to use.Certificate chain of the private key.Certificate revocation check configuration.Explicit secure random to use.Algorithm to use when creating a new secure random.Provider to use when creating a new secure random.trust()List of certificates that form the trust manager.booleantrustAll()Trust any certificate provided by the other side of communication.Trust manager factory algorithm.Trust manager factory provider to use.
-
Field Details
-
DEFAULT_SESSION_CACHE_SIZE
static final int DEFAULT_SESSION_CACHE_SIZEThe default session cache size as defined for unset value inSSLSessionContext.getSessionCacheSize().- See Also:
-
DEFAULT_PROTOCOL
-
DEFAULT_SESSION_TIMEOUT
The default session timeout as defined for unset value inSSLSessionContext.getSessionTimeout().- See Also:
-
-
Method Details
-
builder
Create a new fluent API builder to customize configuration.- Returns:
- a new builder
-
builder
Create a new fluent API builder from an existing instance.- Parameters:
instance- an existing instance used as a base for the builder- Returns:
- a builder based on an instance
-
create
-
create
-
sslContext
Optional<SSLContext> sslContext()Provide a fully configuredSSLContext. If defined, a custom TLS manager and options for context creation, key or trust material, session cache size, and session timeout cannot be configured, and reload of Tls is not supported and will throw an exception. Engine-level options such as enabled protocols, cipher suites, client authentication, and application protocols are supported and are applied to engines created by the context.- Returns:
- SSL context to use
-
manager
TlsManager manager()The configured TLS manager. If one is not explicitly defined in the config then a default manager will be created. Default is either a configuration based TLS manager, or an explicit manager whensslContext()is provided. ATlsinstance backed by the defaultConfiguredTlsManageruses an isolated runtime manager, so this method returns its configured prototype rather than its runtime manager. UseTls.generation()to obtain the runtime manager's material generation.- Returns:
- the configured TLS manager
- See Also:
-
sslParameters
Optional<SSLParameters> sslParameters()Configure SSL parameters. This will always have a value, as we compute ssl parameters in a builder interceptor from configured options.- Returns:
- SSL parameters to use
-
applicationProtocols
-
endpointIdentificationAlgorithm
-
enabled
boolean enabled()Flag indicating whether Tls is enabled. When disabled, all other configuration is ignored.- Returns:
- enabled flag
-
clientAuth
TlsClientAuth clientAuth()Configure requirement for mutual TLS.- Returns:
- what type of mutual TLS to use, defaults to
TlsClientAuth.NONE
-
protocol
String protocol()Configure the protocol used to obtain an instance ofSSLContext.- Returns:
- protocol to use, defaults to "TLS"
-
provider
Use explicit provider to obtain an instance ofSSLContext.- Returns:
- provider to use, defaults to none (only
protocol()is used by default)
-
enabledCipherSuites
-
enabledProtocols
-
sessionCacheSize
int sessionCacheSize()SSL session cache size.- Returns:
- session cache size, defaults to 20480.
-
sessionTimeout
-