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