Class SSLContextBuilder

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 Details

    • create

      public static SSLContextBuilder create(KeyConfig privateKeyConfig)
      Creates a builder of the SSLContext.
      Parameters:
      privateKeyConfig - the required private key configuration parameter
      Returns:
      this builder
    • create

      public static SSLContext create(Config sslConfig)
      Creates SSLContext 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 of IOException or a GeneralSecurityException
    • 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 javax.net.ssl.SSLContext} instance with configured settings.
      Specified by:
      build in interface Builder<SSLContextBuilder,SSLContext>
      Returns:
      the SSL Context built instance
      Throws:
      IllegalStateException - in case of a problem; will wrap either an instance of IOException or a GeneralSecurityException