Package com.clickhouse.client.api.enums
Enum SSLMode
- All Implemented Interfaces:
Serializable,Comparable<SSLMode>,java.lang.constant.Constable
Defines how strictly the client verifies a server identity when a secure protocol is used.
The mode affects only connections that are already using a secure transport (for example,
an https:// endpoint). It does not enable encryption for plain protocols - an
http:// endpoint stays unencrypted whatever the mode is.
Modes from the least to the most strict:
DISABLED- SSL is not used. Plain protocols only.TRUST- the hostname is not verified and any server certificate is accepted, which is susceptible to MITM attacks - use that only for testing or in fully trusted environments. A configured trust store or CA certificate has no effect in this mode and is ignored (a warning is logged); a configured client certificate/key is still applied for mTLS.VERIFY_CA- the server certificate chain is validated against the trust material (default JVM trust store, configured trust store, or a CA certificate), but the hostname is not checked against the certificate.STRICT- full verification (default): certificate chain is validated and the hostname must match the certificate.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionSSL is not used.Full verification: certificate chain is validated and the hostname must match the certificate.The hostname is not verified and any server certificate is accepted.Server certificate chain is validated, but the hostname is not verified. -
Method Summary
Modifier and TypeMethodDescriptionstatic SSLModeCase-insensitive variant ofvalueOf(String).static SSLModeReturns the enum constant of this type with the specified name.static SSLMode[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
DISABLED
SSL is not used. Connection is not encrypted. Doesn't work with HTTPS. Reserved for TCP where protocol doesn't define encryption. -
TRUST
The hostname is not verified and any server certificate is accepted. A configured trust store or CA certificate has no effect in this mode and is ignored (a warning is logged). A configured client certificate/key is still applied for mTLS. -
VERIFY_CA
Server certificate chain is validated, but the hostname is not verified. -
STRICT
Full verification: certificate chain is validated and the hostname must match the certificate. Default mode for HTTPs.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
fromValue
Case-insensitive variant ofvalueOf(String).- Parameters:
value- mode name in any case- Returns:
- matching mode
- Throws:
IllegalArgumentException- when the value does not match any mode
-