Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
164 changes: 164 additions & 0 deletions fluss-common/src/main/java/org/apache/fluss/config/ConfigOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,89 @@ public class ConfigOptions {
+ "from 'security.sasl.plain.credentials' when that credential map is set, "
+ "and can also be configured directly for compatibility.");

// ------------------------------------------------------------------------
// Server-side TLS (transport encryption + mTLS) options
// ------------------------------------------------------------------------

public static final ConfigOption<List<String>> SERVER_SSL_ENABLED_LISTENERS =
key("security.ssl.enabled.listeners")
.stringType()
.asList()
.noDefaultValue()
.withDescription(
"Listener names with TLS enabled, e.g. `CLIENT,INTERNAL`; others "
+ "accept plaintext. Requires `security.ssl.keystore.path`. A "
+ "listener whose `security.protocol.map` entry is `mTLS` must "
+ "be listed here, since it authenticates by certificate. Names "
+ "match exactly: spell and case them as in `bind.listeners` "
+ "and `security.protocol.map`, or no listener is selected.");

public static final ConfigOption<List<String>> SERVER_SSL_ENABLED_PROTOCOLS =
key("security.ssl.enabled.protocols")
.stringType()
.asList()
.defaultValues("TLSv1.2", "TLSv1.3")
.withDescription(
"TLS protocols enabled for incoming connections. `TLSv1.2` is kept "
+ "by default for JDK 8 builds older than 8u261.");

public static final ConfigOption<List<String>> SERVER_SSL_CIPHER_SUITES =
key("security.ssl.cipher.suites")
.stringType()
.asList()
.noDefaultValue()
.withDescription(
"Cipher suites enabled for TLS connections. Empty uses the provider "
+ "defaults.");

public static final ConfigOption<String> SERVER_SSL_KEYSTORE_PATH =
key("security.ssl.keystore.path")
.stringType()
.noDefaultValue()
.withDescription(
"Keystore file with the server certificate and key. Required with "
+ "`security.ssl.enabled.listeners`.");

public static final ConfigOption<Password> SERVER_SSL_KEYSTORE_PASSWORD =
key("security.ssl.keystore.password")
.passwordType()
.noDefaultValue()
.withDescription("The password to access the server keystore.");

public static final ConfigOption<String> SERVER_SSL_KEYSTORE_TYPE =
key("security.ssl.keystore.type")
.stringType()
.defaultValue("JKS")
.withDescription("Format of the server keystore: `JKS` or `PKCS12`.");

public static final ConfigOption<Password> SERVER_SSL_KEY_PASSWORD =
key("security.ssl.key.password")
.passwordType()
.noDefaultValue()
.withDescription(
"Password of the server private key. Defaults to "
+ "`security.ssl.keystore.password`.");

public static final ConfigOption<String> SERVER_SSL_TRUSTSTORE_PATH =
key("security.ssl.truststore.path")
.stringType()
.noDefaultValue()
.withDescription(
"Truststore file holding the certificates the server trusts. Required "
+ "for `mTLS` listeners, to validate client certificates.");

public static final ConfigOption<Password> SERVER_SSL_TRUSTSTORE_PASSWORD =
key("security.ssl.truststore.password")
.passwordType()
.noDefaultValue()
.withDescription("The password to access the server truststore.");

public static final ConfigOption<String> SERVER_SSL_TRUSTSTORE_TYPE =
key("security.ssl.truststore.type")
.stringType()
.defaultValue("JKS")
.withDescription("Format of the server truststore: `JKS` or `PKCS12`.");

public static final ConfigOption<Integer> TABLET_SERVER_ID =
key("tablet-server.id")
.intType()
Expand Down Expand Up @@ -1509,6 +1592,87 @@ public class ConfigOptions {
+ "the server JVM but still need to load authentication plugins "
+ "shipped in plugins/.");

// ------------------------------------------------------------------------
// Client-side TLS (transport encryption + mTLS) options
// ------------------------------------------------------------------------

public static final ConfigOption<Boolean> CLIENT_SSL_ENABLED =
key("client.security.ssl.enabled")
.booleanType()
.defaultValue(false)
.withDescription(
"Whether the client connects over TLS. Must match the listener it "
+ "connects to (`security.ssl.enabled.listeners`).");

public static final ConfigOption<List<String>> CLIENT_SSL_ENABLED_PROTOCOLS =
key("client.security.ssl.enabled.protocols")
.stringType()
.asList()
.defaultValues("TLSv1.2", "TLSv1.3")
.withDescription("TLS protocols enabled for client connections.");

public static final ConfigOption<List<String>> CLIENT_SSL_CIPHER_SUITES =
key("client.security.ssl.cipher.suites")
.stringType()
.asList()
.defaultValues()
.withDescription("Cipher suites enabled for client connections.");

public static final ConfigOption<String> CLIENT_SSL_TRUSTSTORE_PATH =
key("client.security.ssl.truststore.path")
.stringType()
.noDefaultValue()
.withDescription(
"Truststore file holding the certificates the client trusts. If "
+ "unset, the JVM default truststore is used.");

public static final ConfigOption<String> CLIENT_SSL_TRUSTSTORE_PASSWORD =
key("client.security.ssl.truststore.password")
.stringType()
.noDefaultValue()
.withDescription("The password to access the client truststore.");

public static final ConfigOption<String> CLIENT_SSL_TRUSTSTORE_TYPE =
key("client.security.ssl.truststore.type")
.stringType()
.defaultValue("JKS")
.withDescription("Format of the client truststore: `JKS` or `PKCS12`.");

public static final ConfigOption<String> CLIENT_SSL_KEYSTORE_PATH =
key("client.security.ssl.keystore.path")
.stringType()
.noDefaultValue()
.withDescription("Keystore file with the client certificate and key.");

public static final ConfigOption<String> CLIENT_SSL_KEYSTORE_PASSWORD =
key("client.security.ssl.keystore.password")
.stringType()
.noDefaultValue()
.withDescription("The password to access the client keystore.");

public static final ConfigOption<String> CLIENT_SSL_KEYSTORE_TYPE =
key("client.security.ssl.keystore.type")
.stringType()
.defaultValue("JKS")
.withDescription("Format of the client keystore: `JKS` or `PKCS12`.");

public static final ConfigOption<String> CLIENT_SSL_KEY_PASSWORD =
key("client.security.ssl.key.password")
.stringType()
.noDefaultValue()
.withDescription(
"Password of the client private key. Defaults to "
+ "`client.security.ssl.keystore.password`.");

public static final ConfigOption<String> CLIENT_SSL_ENDPOINT_IDENTIFICATION_ALGORITHM =
key("client.security.ssl.endpoint.identification.algorithm")
.stringType()
.defaultValue("https")
.withDescription(
"Algorithm verifying the server hostname against its certificate: "
+ "`https` or `ldaps`. Empty disables the check, which is not "
+ "recommended in production.");

public static final ConfigOption<MemorySize> CLIENT_SCANNER_LOG_FETCH_MAX_BYTES =
key("client.scanner.log.fetch.max-bytes")
.memoryType()
Expand Down
33 changes: 33 additions & 0 deletions fluss-rpc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
The Fluss RPC framework and Netty-based implementation.
</description>

<properties>
<bouncycastle.version>1.85</bouncycastle.version>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.fluss</groupId>
Expand Down Expand Up @@ -65,6 +69,35 @@
<type>test-jar</type>
<scope>test</scope>
</dependency>

<!--
Netty's SelfSignedCertificate, used by the TLS tests to generate key material, prefers
BouncyCastle and only falls back to sun.security.x509 internals, which are inaccessible
on JDK 9+ and unusable from JDK 18 on. Test scope: no BouncyCastle is shipped.
bcutil and bcprov are bcpkix's own transitive dependencies, declared here only to pin
them: bcpkix depends on them through version ranges, which resolve differently over time
and make every build fetch their maven-metadata.xml.
-->
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk18on</artifactId>
<version>${bouncycastle.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcutil-jdk18on</artifactId>
<version>${bouncycastle.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk18on</artifactId>
<version>${bouncycastle.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Loading
Loading