java.lang.Object
io.helidon.nima.common.tls.Tls.Builder
- All Implemented Interfaces:
Builder<Tls.Builder,,Tls> Supplier<Tls>
- Enclosing class:
Tls
Fluent API builder for
Tls.-
Method Summary
Modifier and TypeMethodDescriptionapplicationProtocols(List<String> applicationProtocols) Configure list of supported application protocols (such ash2).build()Build the instance from this builder.Update this builder from configuration.enabled(boolean enabled) Whether the TLS config should be enabled or not.enabledCipherSuites(List<String> enabledCipherSuites) Enabled cipher suites for TLS communication.enabledProtocols(List<String> enabledProtocols) Enabled protocols for TLS communication.endpointIdentificationAlgorithm(String endpointIdentificationAlgorithm) Identification algorithm for SSL endpoints.internalKeystoreProvider(String internalKeystoreProvider) Provider of the key stores used internally to create a key and trust manager factories.internalKeystoreType(String internalKeystoreType) Type of the key stores used internally to create a key and trust manager factories.keyManagerFactoryAlgorithm(String keyManagerFactoryAlgorithm) Algorithm of the key manager factory used when private key is defined.keyManagerFactoryProvider(String keyManagerFactoryProvider) Key manager factory provider.privateKey(PrivateKey privateKey) Private key to use.privateKeyCertChain(List<X509Certificate> privateKeyCertChain) Certificate chain of the private key.Configure the protocol used to obtain an instance ofSSLContext.Use explicit provider to obtain an instance ofSSLContext.secureRandom(SecureRandom secureRandom) Explicit secure random to use.secureRandomAlgorithm(String secureRandomAlgorithm) Algorithm to use when creating a new secure random.secureRandomProvider(String secureRandomProvider) Provider to use when creating a new secure random.sessionCacheSize(int sessionCacheSize) SSL session cache size.sessionTimeout(Duration sessionTimeout) SSL session timeout.sslContext(SSLContext sslContext) Provide a fully configuredSSLContext.sslParameters(SSLParameters sslParameters) Configure SSL parameters.tlsClientAuth(TlsClientAuth tlsClientAuth) Configure requirement for mutual TLS.trustAll(boolean trustAll) Trust any certificate provided by the other side of communication.trustCertificates(List<X509Certificate> trustCertificates) List of certificates that form the trust manager.trustManagerFactoryAlgorithm(String trustManagerFactoryAlgorithm) Trust manager factory algorithm.trustManagerFactoryProvider(String trustManagerFactoryProvider) Trust manager factory provider to use.
-
Method Details
-
build
Description copied from interface:BuilderBuild the instance from this builder.- Specified by:
buildin interfaceBuilder<Tls.Builder,Tls> - Returns:
- instance of the built type
-
protocol
Configure the protocol used to obtain an instance ofSSLContext.- Parameters:
protocol- protocol to use, defaults to "TLS"- Returns:
- updated builder
-
provider
Use explicit provider to obtain an instance ofSSLContext.- Parameters:
provider- provider to use, defaults to none (onlyprotocol(String)is used by default)- Returns:
- updated builder
-
sessionTimeout
SSL session timeout.- Parameters:
sessionTimeout- session timeout, defaults to 30 minutes- Returns:
- updated builder
-
sessionCacheSize
SSL session cache size.- Parameters:
sessionCacheSize- session cache size, defaults to 1024- Returns:
- updated builder
-
enabledCipherSuites
Enabled cipher suites for TLS communication.- Parameters:
enabledCipherSuites- cipher suits to enable, by default (or if list is empty), all available cipher suites are enabled- Returns:
- updated builder
-
enabledProtocols
Enabled protocols for TLS communication. Example of valid values forTLSprotocol:TLSv1.3,TLSv1.2- Parameters:
enabledProtocols- protocols to enable, by default (or if list is empty), all available protocols are enabled- Returns:
- updated builder
-
sslContext
Provide a fully configuredSSLContext. If defined, context related configuration is ignored.- Parameters:
sslContext- SSL context to use- Returns:
- updated builder
-
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).- Parameters:
privateKey- private key to use- Returns:
- updated builder
-
privateKeyCertChain
Certificate chain of the private key.- Parameters:
privateKeyCertChain- private key certificate chain, only used when private key is configured- Returns:
- updated builder
-
keyManagerFactoryAlgorithm
Algorithm of the key manager factory used when private key is defined. Defaults toKeyManagerFactory.getDefaultAlgorithm().- Parameters:
keyManagerFactoryAlgorithm- algorithm to use- Returns:
- updated builder
-
trustCertificates
List of certificates that form the trust manager.- Parameters:
trustCertificates- certificates to be trusted- Returns:
- updated builder
-
secureRandomAlgorithm
Algorithm to use when creating a new secure random.- Parameters:
secureRandomAlgorithm- algorithm to use, by default usesSecureRandomconstructor- Returns:
- updated builder
-
secureRandomProvider
Provider to use when creating a new secure random.- Parameters:
secureRandomProvider- provider to use, by default no provider is specified- Returns:
- updated builder
-
secureRandom
Explicit secure random to use.- Parameters:
secureRandom- secure random to use- Returns:
- updated builder
-
tlsClientAuth
Configure requirement for mutual TLS.- Parameters:
tlsClientAuth- what type of mutual TLS to use, defaults toTlsClientAuth.NONE- Returns:
- updated builder
-
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.- Parameters:
trustAll- whether to trust all certificates, do not use in production- Returns:
- updated builder
-
internalKeystoreType
Type of the key stores used internally to create a key and trust manager factories.- Parameters:
internalKeystoreType- keystore type, defaults toKeyStore.getDefaultType()- Returns:
- updated builder
-
internalKeystoreProvider
Provider of the key stores used internally to create a key and trust manager factories.- Parameters:
internalKeystoreProvider- keystore provider, if not defined, provider is not specified- Returns:
- updated builder
-
keyManagerFactoryProvider
Key manager factory provider.- Parameters:
keyManagerFactoryProvider- provider to use- Returns:
- updated builder
-
trustManagerFactoryAlgorithm
Trust manager factory algorithm.- Parameters:
trustManagerFactoryAlgorithm- algorithm to use- Returns:
- updated builder
-
trustManagerFactoryProvider
Trust manager factory provider to use.- Parameters:
trustManagerFactoryProvider- provider- Returns:
- updated builder
-
sslParameters
Configure SSL parameters.- Parameters:
sslParameters- SSL parameters to use- Returns:
- updated builder
-
endpointIdentificationAlgorithm
Identification algorithm for SSL endpoints.- Parameters:
endpointIdentificationAlgorithm- configure endpoint identification algorithm, or set toNONEto disable endpoint identification (equivalent to hostname verification). Defaults to "HTTPS"- Returns:
- updated builder
-
applicationProtocols
Configure list of supported application protocols (such ash2).- Parameters:
applicationProtocols- application protocols- Returns:
- updated builder
-
config
Update this builder from configuration.- Parameters:
config- config on the node of SSL configuration- Returns:
- this builder
-
enabled
Whether the TLS config should be enabled or not.- Parameters:
enabled- configure tofalseto disable SSL context (and SSL support on the server)- Returns:
- this builder
-