Package io.flipt.client.models
Class TlsConfig
java.lang.Object
io.flipt.client.models.TlsConfig
TLS configuration for connecting to Flipt servers with custom certificates.
This class provides comprehensive TLS configuration options including:
- Custom CA certificates for self-signed or private CAs
- Client certificates for mutual TLS authentication
- Certificate data as strings or file paths
- Insecure mode for development (skip certificate verification)
Certificate data fields take precedence over file path fields when both are provided.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRaw CA certificate content in PEM format.Path to custom CA certificate file in PEM format.Raw client certificate content in PEM format.Path to client certificate file in PEM format.Raw client private key content in PEM format.Path to client private key file in PEM format.Skip hostname verification while maintaining certificate validation.Skip certificate verification entirely.static TlsConfiginsecure()Deprecated.static TlsConfigwithCaCertData(String caCertData) Deprecated.Usebuilder().caCertData(caCertData)instead.static TlsConfigwithCaCertFile(String caCertFile) Deprecated.Usebuilder().caCertFile(caCertFile)instead.static TlsConfigwithMutualTls(String clientCertFile, String clientKeyFile) Deprecated.Usebuilder().clientCertFile(clientCertFile).clientKeyFile(clientKeyFile)instead.static TlsConfigwithMutualTlsData(String clientCertData, String clientKeyData) Deprecated.Usebuilder().clientCertData(clientCertData).clientKeyData(clientKeyData)instead.
-
Constructor Details
-
TlsConfig
public TlsConfig()
-
-
Method Details
-
getCaCertFile
Path to custom CA certificate file in PEM format. Used to verify server certificates signed by custom or self-signed CAs. -
getCaCertData
Raw CA certificate content in PEM format. Used to verify server certificates signed by custom or self-signed CAs. Takes precedence over caCertFile when both are provided. -
getInsecureSkipVerify
Skip certificate verification entirely. WARNING: This should only be used in development environments. Setting this to true makes connections vulnerable to man-in-the-middle attacks. -
getInsecureSkipHostnameVerify
Skip hostname verification while maintaining certificate validation. WARNING: This should only be used when you know what you are doing. This still validates the certificate chain. -
getClientCertFile
Path to client certificate file in PEM format. Used for mutual TLS authentication where the server requires client certificates. -
getClientKeyFile
Path to client private key file in PEM format. Used for mutual TLS authentication where the server requires client certificates. Must correspond to the clientCertFile. -
getClientCertData
Raw client certificate content in PEM format. Used for mutual TLS authentication where the server requires client certificates. Takes precedence over clientCertFile when both are provided. -
getClientKeyData
Raw client private key content in PEM format. Used for mutual TLS authentication where the server requires client certificates. Must correspond to the clientCertData. Takes precedence over clientKeyFile when both are provided. -
insecure
Deprecated.Usebuilder().insecureSkipVerify(true)instead. Creates a TlsConfig for development with insecure certificate verification disabled. WARNING: Only use this in development environments.- Returns:
- TlsConfig with insecure skip verify enabled
-
withCaCertFile
Deprecated.Usebuilder().caCertFile(caCertFile)instead. Creates a TlsConfig with a custom CA certificate from a file.- Parameters:
caCertFile- path to the CA certificate file in PEM format- Returns:
- TlsConfig with custom CA certificate
- Throws:
IllegalArgumentException- if the certificate file does not exist
-
withCaCertData
Deprecated.Usebuilder().caCertData(caCertData)instead. Creates a TlsConfig with a custom CA certificate from string data.- Parameters:
caCertData- CA certificate content in PEM format- Returns:
- TlsConfig with custom CA certificate
-
withMutualTls
Deprecated.Usebuilder().clientCertFile(clientCertFile).clientKeyFile(clientKeyFile)instead. Creates a TlsConfig for mutual TLS with client certificate and key files.- Parameters:
clientCertFile- path to client certificate file in PEM formatclientKeyFile- path to client private key file in PEM format- Returns:
- TlsConfig with mutual TLS configuration
- Throws:
IllegalArgumentException- if either certificate file or key file does not exist
-
withMutualTlsData
Deprecated.Usebuilder().clientCertData(clientCertData).clientKeyData(clientKeyData)instead. Creates a TlsConfig for mutual TLS with client certificate and key data.- Parameters:
clientCertData- client certificate content in PEM formatclientKeyData- client private key content in PEM format- Returns:
- TlsConfig with mutual TLS configuration
-
builder().insecureSkipVerify(true)instead.