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

Set SslContextBuilder.endpointIdentificationAlgorithm for Netty 4.2.x #2985

Merged

Conversation

idelpivnitskiy
Copy link
Member

Motivation:

In version 4.2.x, Netty introduced new API
SslContextBuilder.endpointIdentificationAlgorithm(String) and flipped the default value to HTTPS.

Modifications:

  • Detect presence of this new method and initialize it with the value from config.hostnameVerificationAlgorithm().
  • Verify isOptionSupported method works as expected before initializing its MethodHandle.

Result:

Hostname verification algorithm is enabled/disabled as expected for ST users with Netty 4.2.x in the classpath.

Motivation:

In version 4.2.x, Netty introduced new API
`SslContextBuilder.endpointIdentificationAlgorithm(String)` and flipped
the default value to `HTTPS`.

Modifications:
- Detect presence of this new method and initialize it with the
value from `config.hostnameVerificationAlgorithm()`.

Result:

Hostname verification algorithm is enabled/disabled as expected for ST
users with Netty 4.2.x in the classpath.
@idelpivnitskiy idelpivnitskiy requested a review from daschl June 25, 2024 01:35
@idelpivnitskiy idelpivnitskiy self-assigned this Jun 25, 2024
@idelpivnitskiy idelpivnitskiy requested a review from chrisvest June 25, 2024 01:35
@idelpivnitskiy idelpivnitskiy merged commit 2c90b8d into apple:main Jun 25, 2024
11 checks passed
@idelpivnitskiy idelpivnitskiy deleted the endpointIdentificationAlgorithm branch June 25, 2024 15:13
Copy link
Contributor

@chrisvest chrisvest left a comment

Choose a reason for hiding this comment

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

The SslUtils.newClientSslHandler will still set the endpoint verification algorithm, which shouldn't be a problem. We're just doing the work to configure it twice.

@idelpivnitskiy
Copy link
Member Author

Correct, I left that intentionally as a fallback for Netty 4.1.x

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