Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZOOKEEPER-4912 Remove default TLS cipher overrides #2239

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

stoty
Copy link
Contributor

@stoty stoty commented Mar 25, 2025

No description provided.

Copy link
Contributor

@cnauroth cnauroth left a comment

Choose a reason for hiding this comment

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

@stoty , thank you for the patch. This is a good idea. I entered just one question.

@@ -80,7 +80,10 @@ public SslContext createNettySslContextForClient(ZKConfig config)
}

sslContextBuilder.enableOcsp(config.getBoolean(getSslOcspEnabledProperty()));
sslContextBuilder.protocols(getEnabledProtocols(config));
String[] enabledProtocols = getEnabledProtocols(config);
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@stoty stoty Mar 26, 2025

Choose a reason for hiding this comment

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

You're right, it's not necessary.
However, I think that the if improves readability by handling the null value explicitly, and showing that we leave the defaults in this case.

I can remove it if you prefer.

Copy link
Contributor

Choose a reason for hiding this comment

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

Readability is a good reason to keep this as it is. No change necessary. Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

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

Setting it to null explicitly and not setting it are two different things. What's the default value?
With this behaviour we will keep the default value which I think makes sense in this case.

Copy link
Contributor

@cnauroth cnauroth left a comment

Choose a reason for hiding this comment

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

@stoty , I thought of one more thing. The JIRA issue mentioned discussing the cipher change in documentation. Do you want to include that documentation change in this pull request?

@stoty
Copy link
Contributor Author

stoty commented Mar 26, 2025

@stoty , I thought of one more thing. The JIRA issue mentioned discussing the cipher change in documentation. Do you want to include that documentation change in this pull request?

Yes, I do.
I just need to familiarize myself with how the docs are generated for ZK.

@stoty
Copy link
Contributor Author

stoty commented Mar 26, 2025

I have updated the admin guide, @cnauroth @anmolnar .

We could go into more detail (like the full cipher lists for Java 8/9, or more information on how to influence that cipher selection), but I couldn't find a good place to put that information.

I also couldn't find a focused doc for the relevant JVM config properties, as it's a large topic, as well as being provider dependent.

Please let me know if more documentation is needed, and where I should add that.

@cnauroth
Copy link
Contributor

From my perspective, this looks like sufficient documentation.

Copy link
Contributor

@cnauroth cnauroth left a comment

Choose a reason for hiding this comment

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

+1

I will also follow up on the related discussion on the mailing list:

https://lists.apache.org/thread/3k5m8bx6vb4kp7j042vqlx5vqn8dwh9b

Copy link
Contributor

@anmolnar anmolnar left a comment

Choose a reason for hiding this comment

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

Lgtm. Just a few nitpicks.

Default: Enabled cipher suites depend on the Java runtime version being used.
Default: None, the JVM defaults are used (3.10.0+),
Enabled cipher suites are hard coded, with the ordering dependent on whether Java 8, or Java 9+ is used.
For Java 8 the list begins with the TLSv1.2 CBC ciphers, while for Java 9+ it begins with the TLSv1.2 CBM ciphers (3.5.5-3.9.x).
Copy link
Contributor

Choose a reason for hiding this comment

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

Shall we list the cipher suites explicitly here which were previously in the code?
I know source control preserves it for the future, but I think it could be beneficial here as well for future doc readers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The format of this list doesn't really allow for long readable explanations.

We could add it in a separate section maybe ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good to me, thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added a new section, @anmolnar .

@@ -80,7 +80,10 @@ public SslContext createNettySslContextForClient(ZKConfig config)
}

sslContextBuilder.enableOcsp(config.getBoolean(getSslOcspEnabledProperty()));
sslContextBuilder.protocols(getEnabledProtocols(config));
String[] enabledProtocols = getEnabledProtocols(config);
Copy link
Contributor

Choose a reason for hiding this comment

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

Setting it to null explicitly and not setting it are two different things. What's the default value?
With this behaviour we will keep the default value which I think makes sense in this case.

stoty added 2 commits March 27, 2025 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants