- All Superinterfaces:
Prototype.Api
,Prototype.Factory<Tls>
- All Known Implementing Classes:
TlsConfig.BuilderBase.TlsConfigImpl
Interface generated from definition. Please add javadoc to the definition interface.
- See Also:
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
Fluent API builder forTls
.static class
TlsConfig.BuilderBase<BUILDER extends TlsConfig.BuilderBase<BUILDER,
PROTOTYPE>, PROTOTYPE extends TlsConfig> Fluent API builder base forTls
. -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The default protocol is set to "TLS".static final int
The default session cache size as defined for unset value inSSLSessionContext.getSessionCacheSize()
.static final String
The 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.Builder
builder()
Create a new fluent API builder to customize configuration.static TlsConfig.Builder
Create a new fluent API builder from an existing instance.Configure requirement for mutual TLS.static TlsConfig
create()
Create a new instance with default values.static TlsConfig
Create a new instance from configuration.boolean
enabled()
Flag indicating whether Tls is enabled.Enabled cipher suites for TLS communication.Enabled protocols for TLS communication.Identification algorithm for SSL endpoints.Provider 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.manager()
The Tls manager.Private key to use.Certificate chain of the private key.protocol()
Configure the protocol used to obtain an instance ofSSLContext
.provider()
Use explicit provider to obtain an instance ofSSLContext
.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.int
SSL session cache size.SSL session timeout.Provide a fully configuredSSLContext
.Configure SSL parameters.trust()
List of certificates that form the trust manager.boolean
trustAll()
Trust any certificate provided by the other side of communication.Trust manager factory algorithm.Trust manager factory provider to use.Methods inherited from interface io.helidon.builder.api.Prototype.Factory
build
-
Field Details
-
DEFAULT_PROTOCOL
The default protocol is set to "TLS".- See Also:
-
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_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 a new instance from configuration.- Parameters:
config
- used to configure the new instance- Returns:
- a new instance configured from configuration
-
create
Create a new instance with default values.- Returns:
- a new instance
-
sslContext
Optional<SSLContext> sslContext()Provide a fully configuredSSLContext
. If defined, context related configuration is ignored.- Returns:
- SSL context to use
-
privateKey
Optional<PrivateKey> privateKey()Private key to use. For server side TLS, this is required. For client side TLS, this is optional (used when mutual TLS is enabled).- Returns:
- private key to use
-
privateKeyCertChain
List<X509Certificate> privateKeyCertChain()Certificate chain of the private key.- Returns:
- private key certificate chain, only used when private key is configured
-
trust
List<X509Certificate> trust()List of certificates that form the trust manager.- Returns:
- certificates to be trusted
-
manager
TlsManager manager()The Tls manager. If one is not explicitly defined in the config then a default manager will be created.- Returns:
- the tls manager of the tls instance
- See Also:
-
secureRandom
Optional<SecureRandom> secureRandom()Explicit secure random to use.- Returns:
- secure random to use
-
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
-
secureRandomProvider
Provider to use when creating a new secure random. When defined,secureRandomAlgorithm()
must be defined as well.- Returns:
- provider to use, by default no provider is specified
-
secureRandomAlgorithm
Algorithm to use when creating a new secure random.- Returns:
- algorithm to use, by default uses
SecureRandom
constructor
-
keyManagerFactoryAlgorithm
Algorithm of the key manager factory used when private key is defined. Defaults toKeyManagerFactory.getDefaultAlgorithm()
.- Returns:
- algorithm to use
-
keyManagerFactoryProvider
Key manager factory provider.- Returns:
- provider to use
-
trustManagerFactoryAlgorithm
Trust manager factory algorithm.- Returns:
- algorithm to use
-
trustManagerFactoryProvider
Trust manager factory provider to use.- Returns:
- provider to use
-
applicationProtocols
Configure list of supported application protocols (such ash2
) for application layer protocol negotiation (ALPN).- Returns:
- application protocols
-
endpointIdentificationAlgorithm
String endpointIdentificationAlgorithm()Identification algorithm for SSL endpoints.- Returns:
- configure endpoint identification algorithm, or set to
NONE
to disable endpoint identification (equivalent to hostname verification). Defaults to "HTTPS"
-
enabled
boolean enabled()Flag indicating whether Tls is enabled.- Returns:
- enabled flag
-
trustAll
boolean trustAll()Trust any certificate provided by the other side of communication.This is a dangerous setting: if set to
true
, any certificate will be accepted, throwing away most of the security advantages of TLS. NEVER do this in production.- Returns:
- whether to trust all certificates, do not use in production
-
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
Enabled cipher suites for TLS communication.- Returns:
- cipher suites to enable, by default (or if list is empty), all available cipher suites are enabled
-
enabledProtocols
Enabled protocols for TLS communication. Example of valid values forTLS
protocol:TLSv1.3
,TLSv1.2
- Returns:
- protocols to enable, by default (or if list is empty), all available protocols are enabled
-
sessionCacheSize
int sessionCacheSize()SSL session cache size.- Returns:
- session cache size, defaults to 20480.
-
sessionTimeout
Duration sessionTimeout()SSL session timeout.- Returns:
- session timeout, defaults to "PT24H".
-
internalKeystoreType
Type of the key stores used internally to create a key and trust manager factories.- Returns:
- keystore type, defaults to
KeyStore.getDefaultType()
-
internalKeystoreProvider
Provider of the key stores used internally to create a key and trust manager factories.- Returns:
- keystore provider, if not defined, provider is not specified
-
revocation
Optional<RevocationConfig> revocation()Certificate revocation check configuration.- Returns:
- certificate revocation configuration
-