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

Fix a bug where a tailing dot is not stripped for SNI #6046

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ikhoon
Copy link
Contributor

@ikhoon ikhoon commented Dec 23, 2024

Motivation:

A trailing dot specified in a hostname can be used to make DNS queries to avoid using search domains. However, the trailing dot should be removed for SNI.

https://datatracker.ietf.org/doc/html/rfc6066#section-3

The hostname is represented as a byte string using ASCII encoding
without a trailing dot.

Modifications:

  • Add Endpoint.withTrailingDot() to remove a trailing dot if present.
  • Use an Endpoint without a trailing dot to create a remote address which is used for SNI.

Result:

Motivation:

A trailing dot specified in an hostname can be used to make DNS queries
to avoid using search domains. However, the trailing dot should be
removed for SNI.

https://datatracker.ietf.org/doc/html/rfc6066#section-3
> The hostname is represented as a byte string using ASCII encoding
> without a trailing dot.

Modifications:

- Add `Endpoint.withTrailingDot()` to remove a trailing dot if exists.
- Use an `Endpoint` without a trailing dot create an remote address
  which is used for SNI.

Result:

- Fixed a bug where a trailing dot was included in the hostname used by SNI.
- Closes line#6044
@ikhoon ikhoon added the defect label Dec 23, 2024
@ikhoon ikhoon added this to the 1.32.0 milestone Dec 23, 2024
Copy link
Contributor

@minwoox minwoox left a comment

Choose a reason for hiding this comment

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

Add Endpoint.withTrailingDot() to remove a trailing dot if it exists.

Need to change the description. 😉

Copy link
Contributor

@jrhee17 jrhee17 left a comment

Choose a reason for hiding this comment

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

👍 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SNI Server Name Missing in ClientHello for Domain with Trailing Dot
3 participants