Class FlowServiceTlsOptions.Builder

java.lang.Object
io.superdurable.dex.FlowServiceTlsOptions.Builder
Enclosing class:
FlowServiceTlsOptions

public static final class FlowServiceTlsOptions.Builder extends Object
Builds immutable TLS settings; see FlowServiceTlsOptions for a complete example.
  • Method Details

    • additionalRootCAsPem

      public FlowServiceTlsOptions.Builder additionalRootCAsPem(String value)
      Adds PEM-encoded root certificates to the JDK default trust roots.

      The default null or an empty string uses only the default roots. A nonempty bundle must contain at least one parsable X.509 certificate. Other text and malformed certificate blocks are ignored when another certificate parses. No certificate contents are logged. See FlowServiceTlsOptions for a complete example.

      Parameters:
      value - the PEM bundle, or null to use only default roots
      Returns:
      this builder
    • serverName

      public FlowServiceTlsOptions.Builder serverName(String value)
      Overrides the certificate name, TLS SNI, and HTTP/2 authority.

      The default null uses the address host for verification and SNI, and the address host and port for HTTP/2 authority. Supply a DNS name or unbracketed IP address without a port only when it differs from the endpoint host. An IP name requires a matching IP SAN. A gateway must accept the override as its authority, without a port. Prefer a DNS override for IPv6 endpoints because HTTP/2 authorities require IPv6 brackets. See FlowServiceTlsOptions for an example of configuring TLS.

      Parameters:
      value - the certificate name, or null to use the address host; empty is invalid
      Returns:
      this builder
    • build

      public FlowServiceTlsOptions build()
      Builds immutable TLS settings without opening a connection.
      Returns:
      the configured TLS settings
      Throws:
      IllegalArgumentException - if a nonempty PEM bundle contains no parsable certificate, or the supplied server name is empty or invalid