GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Default hostname validation, configured via SslContextBuilder by chrisvest · Pull Request #14127 · netty/netty

Conversation

@chrisvest

@chrisvest chrisvest commented Jun 14, 2024

Copy link
Copy Markdown
Member

Motivation:
Hostname validation is an important step for clients, in verifying the identity of the server.

We should make it easy to configure.

Due to its importance, we should also enable it by default. While there are theoretically multiple algorithms to choose from for this purpose, the "HTTPS" algorithm is by far the most commonly used one.

Modification:

  • Add a SslContextBuilder.endpointIdentificationAlgorithm() method to configure hostname validation.
  • Set the endpoint validation algorithm to "HTTPS" by default, when creating SslContextBuilders for clients.

Result:
Hostname validation is now enabled by default for clients, and can easily be configured through the SslContext.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@chrisvest
Configure hostname validation via SslContextBuilder
a77a2e0
Motivation:
Hostname validation is an important step for clients, in verifying the identity of the server.

We should make it easy to configure.

Due to its importance, we should also enable it by default.
While there are theoretically multiple algorithms to choose from for this purpose, the "HTTPS" algorithm is *by far* the most commonly used one.

Modification:
- Add a SslContextBuilder.endpointIdentificationAlgorithm() method to configure hostname validation.
- Set the endpoint validation algorithm to "HTTPS" by default, when creating SslContextBuilders for clients.

Result:
Hostname validation is now enabled by default for clients, and can easily be configured through the SslContext.
@chrisvest
chrisvest requested review from ejona86, idelpivnitskiy and normanmaurer June 14, 2024 18:15
@chrisvest

chrisvest commented Jun 14, 2024

Copy link
Copy Markdown
Member Author

I think this is a more reasonable default, and 4.2 is a good version to change the default behavior.

idelpivnitskiy reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chrisvest
Disable hostname verification in tests where it doesn't work
22b4808
@chrisvest
chrisvest marked this pull request as draft June 17, 2024 16:12
chrisvest added 4 commits June 17, 2024 09:13
@chrisvest
Disable hostname verification in another tests
23ed68f
@chrisvest
Disable hostname verification in yet another tests
f1505f4
@chrisvest
Disable hostname verification in transport tests
7afa2e6
@chrisvest
Disable hostname verification in blockhound tests
6924c04
@chrisvest
chrisvest marked this pull request as ready for review June 18, 2024 04:09
@normanmaurer
normanmaurer merged commit 8372a09 into netty:4.2 Jun 18, 2024
@normanmaurer normanmaurer added this to the 4.2.0.Alpha2 milestone Jun 18, 2024
@chrisvest
chrisvest deleted the 4.2-hostname-verification branch June 18, 2024 13:18
normanmaurer pushed a commit that referenced this pull request Jun 18, 2024
@chrisvest @normanmaurer
Default hostname validation, configured via SslContextBuilder (#14127)
0247e66
Motivation:
Hostname validation is an important step for clients, in verifying the
identity of the server.

We should make it easy to configure.

Due to its importance, we should also enable it by default. While there
are theoretically multiple algorithms to choose from for this purpose,
the "HTTPS" algorithm is *by far* the most commonly used one.

Modification:
- Add a SslContextBuilder.endpointIdentificationAlgorithm() method to
configure hostname validation.
- Set the endpoint validation algorithm to "HTTPS" by default, when
creating SslContextBuilders for clients.

Result:
Hostname validation is now enabled by default for clients, and can
easily be configured through the SslContext.
@normanmaurer normanmaurer mentioned this pull request Jun 18, 2024
Default hostname validation, configured via SslContextBuilder (#14127) #14130
Merged
normanmaurer added a commit that referenced this pull request Jun 18, 2024
@normanmaurer @chrisvest
Default hostname validation, configured via SslContextBuilder (#14127) (
526cbe8
#14130)

Motivation:
Hostname validation is an important step for clients, in verifying the
identity of the server.

We should make it easy to configure.

Due to its importance, we should also enable it by default. While there
are theoretically multiple algorithms to choose from for this purpose,
the "HTTPS" algorithm is *by far* the most commonly used one.

Modification:
- Add a SslContextBuilder.endpointIdentificationAlgorithm() method to
configure hostname validation.
- Set the endpoint validation algorithm to "HTTPS" by default, when
creating SslContextBuilders for clients.

Result:
Hostname validation is now enabled by default for clients, and can
easily be configured through the SslContext.

Co-authored-by: Chris Vest <[email protected]>
@idelpivnitskiy

idelpivnitskiy commented Jun 18, 2024

Copy link
Copy Markdown
Member

+1 for more secure default.
There might be a risk for having some legacy library in the classpath that might be affected after upgrade. But if this happens, we can consider offering an opt-out system property in the future releases.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chrisvest

chrisvest commented Jun 18, 2024

Copy link
Copy Markdown
Member Author

Sounds like a plan, Idel.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chrisvest added a commit to chrisvest/netty that referenced this pull request Jul 8, 2024
@chrisvest
Backport the SslContextBuilder.endpointIdentificationAlgorithm method
aba6519
Motivation:
We added this method in 4.2, and set the default endpoint identification algorithm to "HTTPS".
To keep the APIs as similar as possible, and to allow integrators to start referencing the new method early, we backport it to 4.1.
The default endpoint identification algorithm default remains unchanged in 4.1, where it is disabled as it always has been.
At least now it's easier to enable.

Modification:
- Backport the API changes from netty#14127 (8372a09) and netty#14144 (b9552ea).
- Keep the default setting the same, so no tests needs to change.
- Guard the actual SSLParameters API call by a Java 7 version check, which is now necessary since the compatibility baseline is Java 6.

Result:
Netty 4.2 and 4.1 now share the same API for enabling hostname verification.
It's easier to enable hostname verification.
@chrisvest chrisvest mentioned this pull request Jul 8, 2024
Backport the SslContextBuilder.endpointIdentificationAlgorithm method #14174
Merged
SamBarker added a commit to SamBarker/kroxylicious that referenced this pull request Aug 26, 2024
@SamBarker
Enable HTTPS style hostname validation.
abe8d33
Netty 4.2 enables HTTPS style hostname validation by default as its more secure (see netty/netty#14127).  However, the APIs exist in the 4.1, so we can enable them earlier.

Signed-off-by: Sam Barker <[email protected]>

rh-pre-commit.version: 2.0.1
rh-pre-commit.check-secrets: ENABLED
@SamBarker SamBarker mentioned this pull request Aug 26, 2024
Upstream Kafka TLS hostname verification kroxylicious/kroxylicious#1474
Merged
7 tasks
SamBarker added a commit to SamBarker/kroxylicious that referenced this pull request Aug 27, 2024
@SamBarker
Enable HTTPS style hostname validation.
186bd0d
Netty 4.2 enables HTTPS style hostname validation by default as its more secure (see netty/netty#14127).  However, the APIs exist in the 4.1, so we can enable them earlier.

Signed-off-by: Sam Barker <[email protected]>

rh-pre-commit.version: 2.0.1
rh-pre-commit.check-secrets: ENABLED
SamBarker added a commit to SamBarker/kroxylicious that referenced this pull request Aug 27, 2024
@SamBarker
Enable HTTPS style hostname validation.
b85051e
Netty 4.2 enables HTTPS style hostname validation by default as its more secure (see netty/netty#14127).  However, the APIs exist in the 4.1, so we can enable them earlier.

Signed-off-by: Sam Barker <[email protected]>

rh-pre-commit.version: 2.0.1
rh-pre-commit.check-secrets: ENABLED

Signed-off-by: Sam Barker <[email protected]>
k-wall pushed a commit to kroxylicious/kroxylicious that referenced this pull request Aug 27, 2024
@SamBarker @k-wall
Enable HTTPS style hostname validation.
8be1efc
Netty 4.2 enables HTTPS style hostname validation by default as its more secure (see netty/netty#14127).  However, the APIs exist in the 4.1, so we can enable them earlier.

Signed-off-by: Sam Barker <[email protected]>

rh-pre-commit.version: 2.0.1
rh-pre-commit.check-secrets: ENABLED

Signed-off-by: Sam Barker <[email protected]>
@nibix nibix mentioned this pull request Nov 18, 2025
Explicitly configure test classes in test tasks for Gradle 9 update opensearch-project/security#5793
Merged
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@normanmaurer normanmaurer Awaiting requested review from normanmaurer
@ejona86 ejona86 Awaiting requested review from ejona86
@idelpivnitskiy idelpivnitskiy Awaiting requested review from idelpivnitskiy

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

4.2.0.Alpha2

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@chrisvest @idelpivnitskiy @normanmaurer
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.