flink icon indicating copy to clipboard operation
flink copied to clipboard

[FLINK-39969] [runtime] Apply configured SSL protocols and algorithms

Open qiuyanjun888 opened this issue 5 months ago • 2 comments

What is the purpose of the change

This pull request fixes FLINK-39969 so configured SSL protocols and cipher suites are consistently applied to Flink REST SSL services and internal SSL client sockets. Previously, REST server Netty SSL contexts skipped configured protocols/ciphers when no trust manager was installed, and createSSLClientSocketFactory returned the raw socket factory without applying Flink's configured SSL protocol and algorithms.

Brief change log

  • Apply configured REST SSL protocols, cipher suites, and client-auth mode directly on the Netty SslContextBuilder regardless of whether a trust manager is present.
  • Wrap internal SSL client socket factories so each created SSLSocket receives the configured protocols and cipher suites, matching the existing server-side socket factory behavior.
  • Add regression coverage for REST server Netty SSL context configuration and internal SSL client socket configuration.

Verifying this change

This change added tests and can be verified as follows:

  • ./mvnw -pl flink-runtime -Dtest=SSLUtilsTest#testRestServerAppliesConfiguredProtocolsAndCipherSuites+testSetSSLVersionAndCipherSuitesForSSLClientSocket -DfailIfNoTests=false -DskipITs -Dfast -Drat.skip=true -Dcheckstyle.skip=true -Dspotless.check.skip=true test
    • Verified RED before the fix: the new focused tests failed because configured protocols were not applied.
    • Verified GREEN after the fix: Tests run: 2, Failures: 0, Errors: 0, Skipped: 0.
  • ./mvnw -pl flink-runtime -Dtest=SSLUtilsTest -DfailIfNoTests=false -DskipITs -Dfast -Drat.skip=true -Dspotless.check.skip=true test
    • Tests run: 28, Failures: 0, Errors: 0, Skipped: 0.
  • ./mvnw -pl flink-runtime -DskipTests -DskipITs -Drat.skip=true spotless:check
    • BUILD SUCCESS.

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, SSL setup for REST and internal runtime communication
  • 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 (Hermes Agent, OpenAI GPT-5.5)

Generated-by: Hermes Agent (OpenAI GPT-5.5)

qiuyanjun888 avatar Jun 25 '26 03:06 qiuyanjun888

CI report:

  • 92ef4dd9b95fe745e3672ee4abbe32a342c410d5 Azure: SUCCESS
Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

flinkbot avatar Jun 25 '26 03:06 flinkbot

This PR is focused on runtime / SSLUtils protocol and algorithm handling.

@tweise @1996fanrui @RocMarshal could you please take a look when you have time and advise whether this approach is acceptable for this area and can move forward?

qiuyanjun888 avatar Jun 26 '26 02:06 qiuyanjun888

Thanks for the review. Updated in 92ef4dd9b9:

  • Moved REST .clientAuth(clientAuth) out of the common builder chain and now apply it only on the server-side builder when client authentication is enabled.
  • Added DEBUG logging for internal/REST SSL settings, including provider, mode, client auth, protocols, cipher suites, and internal session settings.
  • Added DEBUG logging for RPC/Pekko SSL settings, including enablement, protocol, algorithms, key/trust store configured flags and types, cert-fingerprint configured flag, mutual auth, and SSL engine provider.
  • The new logs do not include passwords or secret material.

Verified locally:

  • git diff --check
  • JAVA_HOME=/opt/data/tools/jdk-17 ./mvnw -pl flink-runtime -Dtest=SSLUtilsTest test
  • JAVA_HOME=/opt/data/tools/jdk-17 ./mvnw -pl flink-rpc/flink-rpc-akka -Dtest=PekkoUtilsTest test

qiuyanjun888 avatar Jul 04 '26 06:07 qiuyanjun888