Package io.helidon.webserver
Class SSLContextBuilder
- java.lang.Object
-
- io.helidon.webserver.SSLContextBuilder
-
- All Implemented Interfaces:
Builder<SSLContext>
,Supplier<SSLContext>
public final class SSLContextBuilder extends Object implements Builder<SSLContext>
Builder for configuring a new SslContext for creation.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SSLContext
build()
Create new{@link SSLContext}
instance with configured settings.static SSLContextBuilder
create(KeyConfig privateKeyConfig)
Creates a builder of theSSLContext
.static SSLContext
create(Config sslConfig)
CreatesSSLContext
from the provided configuration.SSLContextBuilder
sessionCacheSize(long sessionCacheSize)
Set the size of the cache used for storing SSL session objects.SSLContextBuilder
sessionTimeout(long sessionTimeout)
Set the timeout for the cached SSL session objects, in seconds.SSLContextBuilder
trustConfig(KeyConfig trustConfig)
Set the trust key configuration to be used to validate certificates.
-
-
-
Method Detail
-
create
public static SSLContextBuilder create(KeyConfig privateKeyConfig)
Creates a builder of theSSLContext
.- Parameters:
privateKeyConfig
- the required private key configuration parameter- Returns:
- this builder
-
create
public static SSLContext create(Config sslConfig)
CreatesSSLContext
from the provided configuration.- Parameters:
sslConfig
- the ssl configuration- Returns:
- a built
SSLContext
- Throws:
IllegalStateException
- in case of a problem; will wrap either an instance ofIOException
or aGeneralSecurityException
-
trustConfig
public SSLContextBuilder trustConfig(KeyConfig trustConfig)
Set the trust key configuration to be used to validate certificates.- Parameters:
trustConfig
- the trust configuration- Returns:
- an updated builder
-
sessionCacheSize
public SSLContextBuilder sessionCacheSize(long 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:
- an updated builder
-
sessionTimeout
public SSLContextBuilder sessionTimeout(long sessionTimeout)
Set the timeout for the cached SSL session objects, in seconds.0
to use the default value.- Parameters:
sessionTimeout
- the session timeout- Returns:
- an updated builder
-
build
public SSLContext build()
Create new{@link SSLContext}
instance with configured settings.- Specified by:
build
in interfaceBuilder<SSLContext>
- Returns:
- the SSL Context built instance
- Throws:
IllegalStateException
- in case of a problem; will wrap either an instance ofIOException
or aGeneralSecurityException
-
-