Class TlsOptions.Builder

java.lang.Object
codes.grow.packages.betterstack.core.TlsOptions.Builder
Enclosing class:
TlsOptions

public static final class TlsOptions.Builder extends Object
Builder for TlsOptions.
  • Method Details

    • caCertPath

      public TlsOptions.Builder caCertPath(Path path)
      Trusts the CA certificates in a PEM file instead of the system trust store.
      Parameters:
      path - PEM bundle
      Returns:
      this builder
    • caCertPem

      public TlsOptions.Builder caCertPem(String pem)
      Trusts the CA certificates in inline PEM text.
      Parameters:
      pem - PEM bundle
      Returns:
      this builder
    • clientCertPath

      public TlsOptions.Builder clientCertPath(Path path)
      Sets the client certificate file (mutual TLS); requires a key.
      Parameters:
      path - PEM certificate chain
      Returns:
      this builder
    • clientKeyPath

      public TlsOptions.Builder clientKeyPath(Path path)
      Sets the client key file (unencrypted PKCS#8 PEM).
      Parameters:
      path - PEM key
      Returns:
      this builder
    • clientCertPem

      public TlsOptions.Builder clientCertPem(String pem)
      Sets the client certificate as inline PEM.
      Parameters:
      pem - PEM certificate chain
      Returns:
      this builder
    • clientKeyPem

      public TlsOptions.Builder clientKeyPem(Secret pem)
      Sets the client key as inline PEM.
      Parameters:
      pem - PEM key
      Returns:
      this builder
    • insecureSkipVerify

      public TlsOptions.Builder insecureSkipVerify(boolean insecure)
      Disables certificate and host name verification. For tests only; a warning is logged once.
      Parameters:
      insecure - true to disable verification
      Returns:
      this builder
    • build

      public TlsOptions build()
      Builds the options.
      Returns:
      the options