Class TlsConfig.BuilderBase<BUILDER extends TlsConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends TlsConfig>
java.lang.Object
io.helidon.common.tls.TlsMaterial.BuilderBase<BUILDER, PROTOTYPE>
io.helidon.common.tls.TlsConfig.BuilderBase<BUILDER, PROTOTYPE>
- Type Parameters:
BUILDER- type of the builder extending this abstract builderPROTOTYPE- type of the prototype interface that would be built byPrototype.Builder.buildPrototype()
- All Implemented Interfaces:
Prototype.Builder<BUILDER, PROTOTYPE>, ConfigBuilderSupport.ConfiguredBuilder<BUILDER, PROTOTYPE>
- Direct Known Subclasses:
TlsConfig.Builder
- Enclosing interface:
TlsConfig
public abstract static class TlsConfig.BuilderBase<BUILDER extends TlsConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends TlsConfig>
extends TlsMaterial.BuilderBase<BUILDER, PROTOTYPE>
implements ConfigBuilderSupport.ConfiguredBuilder<BUILDER, PROTOTYPE>
Fluent API builder base for
TlsConfig.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classGenerated implementation of the prototype, can be extended by descendant prototype implementations.Nested classes/interfaces inherited from class TlsMaterial.BuilderBase
TlsMaterial.BuilderBase.TlsMaterialImplModifier and TypeClassDescriptionprotected static classGenerated implementation of the prototype, can be extended by descendant prototype implementations. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddApplicationProtocol(String applicationProtocol) Configure list of supported application protocols (such ash2) for application layer protocol negotiation (ALPN).addApplicationProtocols(List<String> applicationProtocols) Configure list of supported application protocols (such ash2) for application layer protocol negotiation (ALPN).addEnabledCipherSuite(String enabledCipherSuite) Enabled cipher suites for TLS communication.addEnabledCipherSuites(List<String> enabledCipherSuites) Enabled cipher suites for TLS communication.addEnabledProtocol(String enabledProtocol) Enabled protocols for TLS communication.addEnabledProtocols(List<String> enabledProtocols) Enabled protocols for TLS communication.Configure list of supported application protocols (such ash2) for application layer protocol negotiation (ALPN).applicationProtocols(List<String> applicationProtocols) Configure list of supported application protocols (such ash2) for application layer protocol negotiation (ALPN).Clear all applicationProtocols.Clear all enabledCipherSuites.Clear all enabledProtocols.Clear existing value of provider.Clear existing value of sslContext.Clear existing value of sslParameters.Configure requirement for mutual TLS.clientAuth(TlsClientAuth clientAuth) Configure requirement for mutual TLS.Update builder from configuration (node of this type).booleanenabled()Flag indicating whether Tls is enabled.enabled(boolean enabled) Flag indicating whether Tls is enabled.Enabled cipher suites for TLS communication.enabledCipherSuites(List<String> enabledCipherSuites) Enabled cipher suites for TLS communication.Enabled protocols for TLS communication.enabledProtocols(List<String> enabledProtocols) Enabled protocols for TLS communication.Identification algorithm for SSL endpoints.endpointIdentificationAlgorithm(String endpointIdentificationAlgorithm) Identification algorithm for SSL endpoints.Update this builder from an existing prototype instance.from(TlsConfig.BuilderBase<?, ?> builder) Update this builder from an existing prototype builder instance.manager()The configured TLS manager.manager(TlsManager manager) The configured TLS manager.booleanService discovery flag formanager().managerDiscoverServices(boolean managerDiscoverServices) Service discovery flag formanager().protected voidHandles providers and decorators.protocol()Configure the protocol used to obtain an instance ofSSLContext.Configure the protocol used to obtain an instance ofSSLContext.provider()Use explicit provider to obtain an instance ofSSLContext.Use explicit provider to obtain an instance ofSSLContext.intSSL session cache size.sessionCacheSize(int sessionCacheSize) SSL session cache size.SSL session timeout.sessionTimeout(Duration sessionTimeout) SSL session timeout.Provide a fully configuredSSLContext.sslContext(SSLContext sslContext) Provide a fully configuredSSLContext.Configure SSL parameters.sslParameters(SSLParameters sslParameters) Configure SSL parameters.toString()protected voidValidates required properties.Methods inherited from class TlsMaterial.BuilderBase
addPrivateKeyCertChain, addPrivateKeyCertChain, addTrust, addTrust, clearInternalKeystoreProvider, clearInternalKeystoreType, clearKeyManagerFactoryAlgorithm, clearKeyManagerFactoryProvider, clearPrivateKey, clearPrivateKeyCertChain, clearRevocation, clearSecureRandom, clearSecureRandomAlgorithm, clearSecureRandomProvider, clearTrust, clearTrustManagerFactoryAlgorithm, clearTrustManagerFactoryProvider, config, from, from, internalKeystoreProvider, internalKeystoreProvider, internalKeystoreType, internalKeystoreType, keyManagerFactoryAlgorithm, keyManagerFactoryAlgorithm, keyManagerFactoryProvider, keyManagerFactoryProvider, privateKey, privateKey, privateKey, privateKey, privateKeyCertChain, privateKeyCertChain, privateKeyCertChain, privateKeyCertChain, revocation, revocation, revocation, revocation, secureRandom, secureRandom, secureRandomAlgorithm, secureRandomAlgorithm, secureRandomProvider, secureRandomProvider, trust, trust, trust, trust, trustAll, trustAll, trustManagerFactoryAlgorithm, trustManagerFactoryAlgorithm, trustManagerFactoryProvider, trustManagerFactoryProviderModifier and TypeMethodDescriptionaddPrivateKeyCertChain(X509Certificate privateKeyCertChain) Certificate chain of the private key.addPrivateKeyCertChain(List<? extends X509Certificate> privateKeyCertChain) Certificate chain of the private key.addTrust(X509Certificate trust) List of certificates that form the trust manager.addTrust(List<? extends X509Certificate> trust) List of certificates that form the trust manager.Clear existing value of internalKeystoreProvider.Clear existing value of internalKeystoreType.Clear existing value of keyManagerFactoryAlgorithm.Clear existing value of keyManagerFactoryProvider.Clear existing value of privateKey.Clear all privateKeyCertChain.Clear existing value of revocation.Clear existing value of secureRandom.Clear existing value of secureRandomAlgorithm.Clear existing value of secureRandomProvider.Clear all trust.Clear existing value of trustManagerFactoryAlgorithm.Clear existing value of trustManagerFactoryProvider.config()Configuration used to configure this instance.from(TlsMaterial prototype) Update this builder from an existing prototype instance.from(TlsMaterial.BuilderBase<?, ?> builder) Update this builder from an existing prototype builder instance.Provider of the key stores used internally to create a key and trust manager factories.internalKeystoreProvider(String internalKeystoreProvider) 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.internalKeystoreType(String internalKeystoreType) 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.keyManagerFactoryAlgorithm(String keyManagerFactoryAlgorithm) Algorithm of the key manager factory used when private key is defined.Key manager factory provider.keyManagerFactoryProvider(String keyManagerFactoryProvider) Key manager factory provider.Private key to use.privateKey(Keys privateKey) Private key to use.privateKey(PrivateKey privateKey) Private key to use.privateKey(Consumer<Keys.Builder> consumer) Private key to use.Certificate chain of the private key.privateKeyCertChain(Keys privateKeyCertChain) Certificate chain of the private key.privateKeyCertChain(Consumer<Keys.Builder> consumer) Certificate chain of the private key.privateKeyCertChain(List<? extends X509Certificate> privateKeyCertChain) Certificate chain of the private key.Certificate revocation check configuration.revocation(RevocationConfig revocation) Certificate revocation check configuration.revocation(Consumer<RevocationConfig.Builder> consumer) Certificate revocation check configuration.revocation(Supplier<? extends RevocationConfig> supplier) Certificate revocation check configuration.Explicit secure random to use.secureRandom(SecureRandom secureRandom) Explicit secure random to use.Algorithm to use when creating a new secure random.secureRandomAlgorithm(String secureRandomAlgorithm) Algorithm to use when creating a new secure random.Provider to use when creating a new secure random.secureRandomProvider(String secureRandomProvider) Provider to use when creating a new secure random.trust()List of certificates that form the trust manager.List of certificates that form the trust manager.trust(Consumer<Keys.Builder> consumer) List of certificates that form the trust manager.trust(List<? extends X509Certificate> trust) List of certificates that form the trust manager.booleantrustAll()Trust any certificate provided by the other side of communication.trustAll(boolean trustAll) Trust any certificate provided by the other side of communication.Trust manager factory algorithm.trustManagerFactoryAlgorithm(String trustManagerFactoryAlgorithm) Trust manager factory algorithm.Trust manager factory provider to use.trustManagerFactoryProvider(String trustManagerFactoryProvider) Trust manager factory provider to use.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Prototype.Builder
buildPrototype, self
-
Constructor Details
-
BuilderBase
protected BuilderBase()Protected to support extensibility.
-
-
Method Details
-
from
-
from
Update this builder from an existing prototype builder instance.- Parameters:
builder- existing builder prototype to update this builder from- Returns:
- updated builder instance
-
config
Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.- Specified by:
configin interfaceConfigBuilderSupport.ConfiguredBuilder<BUILDER extends TlsConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends TlsConfig>- Overrides:
configin classTlsMaterial.BuilderBase<BUILDER extends TlsConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends TlsConfig>- Parameters:
config- configuration instance used to obtain values to update this builder- Returns:
- updated builder instance
-
clearSslContext
Clear existing value of sslContext.- Returns:
- updated builder instance
- See Also:
-
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.- Parameters:
sslContext- SSL context to use- Returns:
- updated builder instance
- See Also:
-
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.- Parameters:
manager- the configured TLS manager- Returns:
- updated builder instance
- See Also:
-
clearSslParameters
Clear existing value of sslParameters.- Returns:
- updated builder instance
- See Also:
-
sslParameters
Configure SSL parameters. This will always have a value, as we compute ssl parameters in a builder interceptor from configured options.- Parameters:
sslParameters- SSL parameters to use- Returns:
- updated builder instance
- See Also:
-
clearApplicationProtocols
Clear all applicationProtocols.- Returns:
- updated builder instance
- See Also:
-
applicationProtocols
-
addApplicationProtocols
-
addApplicationProtocol
-
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 instance
- See Also:
-
enabled
Flag indicating whether Tls is enabled. When disabled, all other configuration is ignored.- Parameters:
enabled- enabled flag- Returns:
- updated builder instance
- See Also:
-
clientAuth
Configure requirement for mutual TLS.- Parameters:
clientAuth- what type of mutual TLS to use, defaults toTlsClientAuth.NONE- Returns:
- updated builder instance
- See Also:
-
protocol
Configure the protocol used to obtain an instance ofSSLContext.- Parameters:
protocol- protocol to use, defaults to "TLS"- Returns:
- updated builder instance
- See Also:
-
clearProvider
Clear existing value of provider.- Returns:
- updated builder instance
- See Also:
-
provider
Use explicit provider to obtain an instance ofSSLContext.- Parameters:
provider- provider to use, defaults to none (onlyprotocol()is used by default)- Returns:
- updated builder instance
- See Also:
-
clearEnabledCipherSuites
Clear all enabledCipherSuites.- Returns:
- updated builder instance
- See Also:
-
enabledCipherSuites
-
addEnabledCipherSuites
-
addEnabledCipherSuite
-
clearEnabledProtocols
Clear all enabledProtocols.- Returns:
- updated builder instance
- See Also:
-
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 instance
- See Also:
-
addEnabledProtocols
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 instance
- See Also:
-
addEnabledProtocol
Enabled protocols for TLS communication. Example of valid values forTLSprotocol:TLSv1.3,TLSv1.2- Parameters:
enabledProtocol- add single protocols to enable, by default (or if list is empty), all available protocols are enabled- Returns:
- updated builder instance
- See Also:
-
sessionCacheSize
SSL session cache size.- Parameters:
sessionCacheSize- session cache size, defaults to 20480.- Returns:
- updated builder instance
- See Also:
-
sessionTimeout
-
managerDiscoverServices
Service discovery flag formanager(). If set totrue, services will be discovered from Java service loader, or Helidon ServiceRegistry.- Parameters:
managerDiscoverServices- whether to enable automatic service discovery- Returns:
- updated builder instance
- See Also:
-
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
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
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
public boolean enabled()Flag indicating whether Tls is enabled. When disabled, all other configuration is ignored.- Returns:
- enabled flag
-
clientAuth
Configure requirement for mutual TLS.- Returns:
- what type of mutual TLS to use, defaults to
TlsClientAuth.NONE
-
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
public int sessionCacheSize()SSL session cache size.- Returns:
- session cache size, defaults to 20480.
-
sessionTimeout
SSL session timeout.- Returns:
- session timeout, defaults to "PT24H".
-
managerDiscoverServices
public boolean managerDiscoverServices()Service discovery flag formanager(). If set totrue, services will be discovered from Java service loader, or Helidon ServiceRegistry.- Returns:
- whether to enable automatic service discovery
- See Also:
-
toString
- Overrides:
toStringin classTlsMaterial.BuilderBase<BUILDER extends TlsConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends TlsConfig>
-
preBuildPrototype
protected void preBuildPrototype()Handles providers and decorators.- Overrides:
preBuildPrototypein classTlsMaterial.BuilderBase<BUILDER extends TlsConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends TlsConfig>
-
validatePrototype
protected void validatePrototype()Validates required properties.- Overrides:
validatePrototypein classTlsMaterial.BuilderBase<BUILDER extends TlsConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends TlsConfig>
-