java.lang.Object
io.helidon.webserver.WebServerTls.Builder
- All Implemented Interfaces:
Builder<WebServerTls.Builder,
,WebServerTls> Supplier<WebServerTls>
- Enclosing class:
- WebServerTls
public static class WebServerTls.Builder
extends Object
implements Builder<WebServerTls.Builder,WebServerTls>
Fluent API builder for
WebServerTls
.-
Method Summary
Modifier and TypeMethodDescriptionallowedCipherSuite
(List<String> cipherSuite) Set allowed cipher suite.build()
Build the instance from this builder.clientAuth
(ClientAuthentication clientAuth) Configures whether client authentication will be required or not.Update this builder from configuration.enabled
(boolean enabled) Whether the TLS config should be enabled or not.enabledProtocols
(String... protocols) Configures the TLS protocols to enable with the server socket.enabledProtocols
(Collection<String> protocols) Configures the TLS protocols to enable with the server socket.privateKey
(KeyConfig privateKeyConfig) Configure private key to use for SSL context.privateKey
(Supplier<KeyConfig> privateKeyConfigBuilder) Configure private key to use for SSL context.sessionCacheSize
(long sessionCacheSize) Set the size of the cache used for storing SSL session objects.sessionTimeout
(long timeout, TimeUnit unit) Set the timeout for the cached SSL session objects.sessionTimeoutSeconds
(long sessionTimeout) Set the timeout for the cached SSL session objects, in seconds.sslContext
(SSLContext context) Explicitly configures aSSLContext
to use with the server socket.tlsManager
(TlsManager tlsManager) The Tls manager.Set the trust key configuration to be used to validate certificates.Set the trust key configuration to be used to validate certificates.trustAll
(boolean trustAll) Trust any certificate provided by the other side of communication.
-
Method Details
-
build
Description copied from interface:Builder
Build the instance from this builder.- Specified by:
build
in interfaceBuilder<WebServerTls.Builder,
WebServerTls> - Returns:
- instance of the built type
-
config
Update this builder from configuration.- Parameters:
config
- config on the node of SSL configuration- Returns:
- this builder
-
tlsManager
The Tls manager. If one is not explicitly defined in the config then a default manager will be created.- Parameters:
tlsManager
- the Tls manager- Returns:
- the tls manager of the tls instance
- See Also:
-
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
- flag indicating whether to trust all certificates- Returns:
- whether to trust all certificates, do not use in production
-
clientAuth
Configures whether client authentication will be required or not.- Parameters:
clientAuth
- client authentication- Returns:
- this builder
-
sslContext
Explicitly configures aSSLContext
to use with the server socket. If notnull
then the server enforces an SSL communication, and will override the usage of anyTlsManager
.- Parameters:
context
- a SSL context to use- Returns:
- this builder
-
enabledProtocols
Configures the TLS protocols to enable with the server socket.- Parameters:
protocols
- protocols to enable, if empty, enables defaults- Returns:
- this builder
- Throws:
NullPointerException
- in case the protocols is null
-
enabledProtocols
Configures the TLS protocols to enable with the server socket.- Parameters:
protocols
- protocols to enable, if empty enables the default protocols- Returns:
- this builder
- Throws:
NullPointerException
- in case the protocols is null
-
privateKey
Configure private key to use for SSL context.- Parameters:
privateKeyConfig
- the required private key configuration parameter- Returns:
- this builder
-
privateKey
Configure private key to use for SSL context.- Parameters:
privateKeyConfigBuilder
- the required private key configuration parameter- Returns:
- this builder
-
trust
Set the trust key configuration to be used to validate certificates.- Parameters:
trustConfig
- the trust configuration- Returns:
- this builder
-
trust
Set the trust key configuration to be used to validate certificates.- Parameters:
trustConfigBuilder
- the trust configuration builder- Returns:
- this builder
-
sessionCacheSize
Set the size of the cache used for storing SSL session objects.0
to use the default value.- Parameters:
sessionCacheSize
- the session cache size- Returns:
- this builder
-
sessionTimeoutSeconds
Set the timeout for the cached SSL session objects, in seconds.0
to use the default value.- Parameters:
sessionTimeout
- the session timeout- Returns:
- this builder
-
sessionTimeout
Set the timeout for the cached SSL session objects.0
to use the default value.- Parameters:
timeout
- the session timeout amountunit
- the session timeout time unit- Returns:
- this builder
-
allowedCipherSuite
Set allowed cipher suite. If an empty collection is set, an exception is thrown since it is required to support at least some ciphers.- Parameters:
cipherSuite
- allowed cipher suite- Returns:
- an updated builder
-
enabled
Whether the TLS config should be enabled or not.- Parameters:
enabled
- configure tofalse
to disable SSL context (and SSL support on the server)- Returns:
- this builder
-