Skip to content

HDDS-15152. SSL protocol config is not applied to Jetty when set to default value#10165

Open
dombizita wants to merge 2 commits intoapache:masterfrom
dombizita:HDDS-15152
Open

HDDS-15152. SSL protocol config is not applied to Jetty when set to default value#10165
dombizita wants to merge 2 commits intoapache:masterfrom
dombizita:HDDS-15152

Conversation

@dombizita
Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

In HttpServer2.setEnabledProtocols(), the logic that applies SSL protocol restrictions to the Jetty SslContextFactory is gated behind a check that compares the resolved configuration value against SSLFactory.SSL_ENABLED_PROTOCOLS_DEFAULT ("TLSv1.2").

This means that Jetty is not respecting the configuration, the condition check should be removed.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-15152

How was this patch tested?

Tested the changes manually with openssl s_client -connect commands.

@dombizita dombizita requested a review from fapifta April 30, 2026 20:29
@jojochuang
Copy link
Copy Markdown
Contributor

need unit tests

@dombizita
Copy link
Copy Markdown
Contributor Author

Thanks for the review @jojochuang, in the latest commit I added unit tests (non default value/default value/no config set)

@dombizita dombizita requested review from adoroszlai and jojochuang May 5, 2026 08:00
@dombizita
Copy link
Copy Markdown
Contributor Author

@octachoron could you please review it? thanks!

List<String> finalExcludedProtocols = new ArrayList<>(originalExcludedProtocols);
finalExcludedProtocols.removeAll(Arrays.asList(enabledProtocolsArray));
List<String> finalExcludedProtocols = new ArrayList<>(originalExcludedProtocols);
finalExcludedProtocols.removeAll(Arrays.asList(enabledProtocolsArray));
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

does it mean that you want whitelisted protocols to be removed from the blacklist? Usually exclude list overrides white list.

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.

IIRC it is a Jetty specific semantics. Yes, exclude list takes precendece over white list.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I didn't change this behaviour (it's only modified because of removing the if condition and needed to adjust them). This behaviour was ported in #10111 from HADOOP-15169 and HADOOP-19546 to Ozone's HttpServer2 fork. There is a comment in Hadoop, which explains it:

      // Jetty 9.2.4.v20141103 and above excludes certain protocols by
      // default. Remove the user enabled protocols from the exclude list,
      // and add them into the include list.

SslContextFactory in Jetty applies excludes with higher priority than includes.

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.

3 participants