gaborgsomogyi opened a new pull request, #30199: URL: https://github.com/apache/flink/pull/30199
## What is the purpose of the change Since [FLINK-32035](https://issues.apache.org/jira/browse/FLINK-32035) (1.18.0), REST SSL accepts a missing truststore so that REST clients can fall back to the default truststore of the JDK. The REST server shares that code path: with `security.ssl.rest.authentication-enabled: true` and no truststore, the client authentication (configured inside the block that only runs when a truststore exists) was skipped silently, and the server never requested a client certificate. Before FLINK-32035 this configuration failed at startup. The REST server (JobManager, SQL Gateway, HistoryServer) now fails at startup again in that case, with a message that names the options. The REST client keeps its fallback. ## Brief change log - `SSLUtils`: a REST server that requires client certificates and has no truststore throws an `IllegalConfigurationException`. The client authentication no longer depends on the truststore block. - `SSLUtils`: errors for a missing REST truststore or password name the REST options instead of the internal ones. - `security-ssl.md` (English and Chinese): documents the truststore requirement of the REST server and the default truststore fallback of the REST client. ## Verifying this change This change added tests and can be verified as follows: - `SSLUtilsTest`: the exact failure for a missing truststore, real TLS handshakes (the server rejects a client without a certificate and accepts a trusted one), and the client fallback. Two existing message tests now assert the exact text. `RestServerEndpointConfigurationTest#testMutualAuthWithoutTrustStore`: the failure surfaces at server startup. - The two tests for the fix fail on master (`f86f5b287ee`) with `Expecting code to raise a throwable`. The other new tests guard unchanged behavior and fail when the change is broken on purpose. - `mvn clean verify` of `flink-runtime` and its dependencies passes except `ProfilingServiceTest#testRollingDeletion`, which is unrelated to SSL and passes alone on master and on this branch. `SSLUtilsTest` also passes with the OpenSSL provider, as do `SqlClientSSLTest`, `SqlGatewayRestEndpointITCase`, `DefaultCLITest` and the production `ArchitectureTest`. - Manually verified on the official `flink:2.3.0-java17` image: without a truststore the REST endpoint accepts clients without a certificate. With this change applied to its `SSLUtils`, the JobManager exits at startup with the new message. Not run locally, so left to CI: `mvn clean verify` of the whole repository and the end-to-end tests (the only SSL one, `test_file_sink.sh`, always sets a truststore). ## Does this pull request potentially affect one of the following parts: - Dependencies (does it add or upgrade a dependency): no - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: no - The serializers: no - The runtime per-record code paths (performance sensitive): no - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: yes, the REST endpoint refuses to start with mutual authentication and no truststore. - The S3 file system connector: no ## Documentation - Does this pull request introduce a new feature? no - If yes, how is the feature documented? not applicable --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes (please specify the tool below) Generated-by: Claude Code (Claude Sonnet 5.5) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
