Interface TlsConfig

All Superinterfaces:
Prototype.Api, Prototype.Factory<Tls>, TlsMaterial
All Known Implementing Classes:
TlsConfig.BuilderBase.TlsConfigImpl

public interface TlsConfig extends Prototype.Api, TlsMaterial
TLS configuration, used by web server listeners, web client and other components that need TLS.
See Also:
  • Field Details

  • Method Details

    • builder

      static TlsConfig.Builder builder()
      Create a new fluent API builder to customize configuration.
      Returns:
      a new builder
    • builder

      static TlsConfig.Builder builder(TlsConfig instance)
      Create a new fluent API builder from an existing instance.
      Parameters:
      instance - an existing instance used as a base for the builder
      Returns:
      a builder based on an instance
    • create

      static TlsConfig create(Config config)
      Create a new instance from configuration.
      Parameters:
      config - used to configure the new instance
      Returns:
      a new instance configured from configuration
    • create

      static TlsConfig create()
      Create a new instance with default values.
      Returns:
      a new instance
    • sslContext

      Optional<SSLContext> sslContext()
      Provide a fully configured SSLContext. If defined, a custom TLS manager and options for context creation, key or trust material, session cache size, and session timeout cannot be configured, and reload of Tls is not supported and will throw an exception. Engine-level options such as enabled protocols, cipher suites, client authentication, and application protocols are supported and are applied to engines created by the context.
      Returns:
      SSL context to use
    • manager

      TlsManager manager()
      The configured TLS manager. If one is not explicitly defined in the config then a default manager will be created. Default is either a configuration based TLS manager, or an explicit manager when sslContext() is provided. A Tls instance backed by the default ConfiguredTlsManager uses an isolated runtime manager, so this method returns its configured prototype rather than its runtime manager. Use Tls.generation() to obtain the runtime manager's material generation.
      Returns:
      the configured TLS manager
      See Also:
    • sslParameters

      Optional<SSLParameters> sslParameters()
      Configure SSL parameters. This will always have a value, as we compute ssl parameters in a builder interceptor from configured options.
      Returns:
      SSL parameters to use
    • applicationProtocols

      List<String> applicationProtocols()
      Configure list of supported application protocols (such as h2) for application layer protocol negotiation (ALPN).
      Returns:
      application protocols
    • endpointIdentificationAlgorithm

      String endpointIdentificationAlgorithm()
      Identification algorithm for SSL endpoints.
      Returns:
      configure endpoint identification algorithm, or set to NONE to disable endpoint identification (equivalent to hostname verification). Defaults to "HTTPS"
    • enabled

      boolean enabled()
      Flag indicating whether Tls is enabled. When disabled, all other configuration is ignored.
      Returns:
      enabled flag
    • clientAuth

      TlsClientAuth clientAuth()
      Configure requirement for mutual TLS.
      Returns:
      what type of mutual TLS to use, defaults to TlsClientAuth.NONE
    • protocol

      String protocol()
      Configure the protocol used to obtain an instance of SSLContext.
      Returns:
      protocol to use, defaults to "TLS"
    • provider

      Optional<String> provider()
      Use explicit provider to obtain an instance of SSLContext.
      Returns:
      provider to use, defaults to none (only protocol() is used by default)
    • enabledCipherSuites

      List<String> enabledCipherSuites()
      Enabled cipher suites for TLS communication.
      Returns:
      cipher suites to enable, by default (or if list is empty), all available cipher suites are enabled
    • enabledProtocols

      List<String> enabledProtocols()
      Enabled protocols for TLS communication. Example of valid values for TLS protocol: TLSv1.3, TLSv1.2
      Returns:
      protocols to enable, by default (or if list is empty), all available protocols are enabled
    • sessionCacheSize

      int sessionCacheSize()
      SSL session cache size.
      Returns:
      session cache size, defaults to 20480.
    • sessionTimeout

      Duration sessionTimeout()
      SSL session timeout.
      Returns:
      session timeout, defaults to "PT24H".