Skip to content

[FLINK-39969][runtime] use the same SSL protcol and algorithms in flink#28553

Open
JozsefKuti wants to merge 1 commit into
apache:masterfrom
JozsefKuti:FLINK-39969-ssl-protocols-ciphers
Open

[FLINK-39969][runtime] use the same SSL protcol and algorithms in flink#28553
JozsefKuti wants to merge 1 commit into
apache:masterfrom
JozsefKuti:FLINK-39969-ssl-protocols-ciphers

Conversation

@JozsefKuti

Copy link
Copy Markdown

What is the purpose of the change

Use the same SSL protcol and algorithms configuration properties in all the flink services and all clients with additional debug logs to make ssl setup visible if needed.

In our flink environment we have to support custom security.ssl.protocol and security.ssl.algorithms configuration, so we had to test through from Tlsv1.2 to Tlsv1.2,Tlsv1.3 till pure Tlsv1.3 tls protocol setups using default and non-default ciphers sets.

In the cases where there was a common set between the configured and the default java ssl.protocol-ssl.algorithms setup, then everything worked fine, there was a tls version and cipher to use between the client and service side.
However when the cases where there was not any common set we faced

  • BlobClient cannot connect to its service:
    • org.apache.flink.runtime.blob.Connection - Error wBlobServerhile executing BLOB connection from /0:0:0:0:0:0:0:1:41630.
  • MiniDispatcherRestEndpoint fails with: javax.net.ssl.SSLHandshakeException: no cipher suites in common

Brief change log

org.apache.flink.runtime.net.SSLUtils needs the following adjustments:

Verifying this change

org.apache.flink.runtime.net.SSLUtilsTest had been extended with the following test cases - using TDD where the new tests were failing without the code fixes:

  • testRESTServerSSLConfigCipherAlgorithmsWithoutMutualAuth
  • testRESTServerSSLEngineUsesConfiguredProtocolsAndCipherSuites
  • testSetSSLVersionAndCipherSuitesForSSLClientSocket

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: no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? no

@flinkbot

flinkbot commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

CI report:

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

@spuru9

spuru9 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Hi
Can you add the AI declaration to the PR Description.

@spuru9 spuru9 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you tak a look at some minor nits.

/** Common utilities to manage SSL transport settings. */
public class SSLUtils {

private static final org.slf4j.Logger LOG = LoggerFactory.getLogger(SSLUtils.class);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private static final org.slf4j.Logger LOG = LoggerFactory.getLogger(SSLUtils.class);
private static final Logger LOG = LoggerFactory.getLogger(SSLUtils.class);

Keep import alongside others.

String[] protocols = getEnabledProtocols(config);
String[] cipherSuites = getEnabledCipherSuites(config);

if (LOG.isDebugEnabled()) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These four near-identical blocks are a lot of noise for diagnostic logging. Consider a tiny private helper like logSslDiag(String scope, String[] protocols, Iterable ciphers).
Also the [SSL-DIAG] bracket-prefix style isn't used elsewhere in Flink loggin

private final String[] cipherSuites;

ConfiguringSSLClientSocketFactory(
javax.net.ssl.SSLSocketFactory sslSocketFactory,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: drop the fully-qualified names (javax.net.ssl.SSLSocket, java.net.Socket, etc.) in favor of import

@github-actions github-actions Bot added the community-reviewed PR has been reviewed by the community. label Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-reviewed PR has been reviewed by the community.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants