- java.lang.Object
-
- io.helidon.webserver.TlsConfig.Builder
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TlsConfigbuild()TlsConfig.Builderconfig(Config config)Update this builder from configuration.TlsConfig.Builderenabled(boolean enabled)Whether the TLS config should be enabled or not.TlsConfig.BuilderenabledProtocols(String... protocols)Configures the TLS protocols to enable with the server socket.TlsConfig.BuilderenabledProtocols(Collection<String> protocols)Configures the TLS protocols to enable with the server socket.TlsConfig.BuilderprivateKey(KeyConfig privateKeyConfig)Configure private key to use for SSL context.TlsConfig.BuilderprivateKey(Supplier<KeyConfig> privateKeyConfigBuilder)Configure private key to use for SSL context.TlsConfig.BuildersessionCacheSize(long sessionCacheSize)Set the size of the cache used for storing SSL session objects.TlsConfig.BuildersessionTimeout(long timeout, TimeUnit unit)Set the timeout for the cached SSL session objects.TlsConfig.BuildersessionTimeoutSeconds(long sessionTimeout)Set the timeout for the cached SSL session objects, in seconds.TlsConfig.BuildersslContext(SSLContext context)Configures aSSLContextto use with the server socket.TlsConfig.Buildertrust(KeyConfig trustConfig)Set the trust key configuration to be used to validate certificates.TlsConfig.Buildertrust(Supplier<KeyConfig> trustConfigBuilder)Set the trust key configuration to be used to validate certificates.
-
-
-
Method Detail
-
config
public TlsConfig.Builder config(Config config)
Update this builder from configuration.- Parameters:
config- config on the node of SSL configuration- Returns:
- this builder
-
sslContext
public TlsConfig.Builder sslContext(SSLContext context)
Configures aSSLContextto use with the server socket. If notnullthen the server enforces an SSL communication.- Parameters:
context- a SSL context to use- Returns:
- this builder
-
enabledProtocols
public TlsConfig.Builder enabledProtocols(String... protocols)
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
public TlsConfig.Builder enabledProtocols(Collection<String> protocols)
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
public TlsConfig.Builder privateKey(KeyConfig privateKeyConfig)
Configure private key to use for SSL context.- Parameters:
privateKeyConfig- the required private key configuration parameter- Returns:
- this builder
-
privateKey
public TlsConfig.Builder privateKey(Supplier<KeyConfig> privateKeyConfigBuilder)
Configure private key to use for SSL context.- Parameters:
privateKeyConfigBuilder- the required private key configuration parameter- Returns:
- this builder
-
trust
public TlsConfig.Builder trust(KeyConfig trustConfig)
Set the trust key configuration to be used to validate certificates.- Parameters:
trustConfig- the trust configuration- Returns:
- this builder
-
trust
public TlsConfig.Builder trust(Supplier<KeyConfig> trustConfigBuilder)
Set the trust key configuration to be used to validate certificates.- Parameters:
trustConfigBuilder- the trust configuration builder- Returns:
- this builder
-
sessionCacheSize
public TlsConfig.Builder sessionCacheSize(long sessionCacheSize)
Set the size of the cache used for storing SSL session objects.0to use the default value.- Parameters:
sessionCacheSize- the session cache size- Returns:
- this builder
-
sessionTimeoutSeconds
public TlsConfig.Builder sessionTimeoutSeconds(long sessionTimeout)
Set the timeout for the cached SSL session objects, in seconds.0to use the default value.- Parameters:
sessionTimeout- the session timeout- Returns:
- this builder
-
sessionTimeout
public TlsConfig.Builder sessionTimeout(long timeout, TimeUnit unit)
Set the timeout for the cached SSL session objects.0to use the default value.- Parameters:
timeout- the session timeout amountunit- the session timeout time unit- Returns:
- this builder
-
enabled
public TlsConfig.Builder enabled(boolean 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
-
-