Skip to content

xds: Remove isXdsSniEnabled and align SNI logic with gRFC A101#12625

Merged
kannanjgithub merged 2 commits intogrpc:masterfrom
becomeStar:cleanup/xds-sni-legacy
Feb 6, 2026
Merged

xds: Remove isXdsSniEnabled and align SNI logic with gRFC A101#12625
kannanjgithub merged 2 commits intogrpc:masterfrom
becomeStar:cleanup/xds-sni-legacy

Conversation

@becomeStar
Copy link
Contributor

@becomeStar becomeStar commented Jan 25, 2026

Description

Remove the isXdsSniEnabled (GRPC_EXPERIMENTAL_XDS_SNI) guard so that SNI determination via xDS is always enabled. This aligns the behavior with
gRFC A101, where SNI is determined by xDS configurations such as auto_host_sni or UpstreamTlsContext.sni, without relying on an
experimental toggle.

This change does not remove the GRPC_USE_CHANNEL_AUTHORITY_IF_NO_SNI_APPLICABLE fallback logic, which remains unchanged.

Changes

  • Remove the isXdsSniEnabled flag and the related conditional logic.
  • Remove test cases that specifically covered behavior when the
    experimental flag was disabled, since the flag is no longer supported.

Note for Reviewers

Some test files show large diffs because of re-indentation after removing
try-finally blocks (since the isXdsSniEnabled flag is no longer needed).
I recommend reviewing these files with the 'Hide whitespace changes'
option enabled.

Ref #11784

Remove the isXdsSniEnabled environment variable guard and the legacy
logic that falls back to the channel authority for SNI. This aligns
the implementation with gRFC A101, ensuring no SNI is sent if it is
not explicitly determined by xDS configurations.

Update the test suite by removing the isXdsSniEnabled flag and deleting
test case that specifically verified behavior when the flag was set to
false. Additionally, add a new test case to verify that SNI is omitted
when none of the A101 conditions are met, ensuring the SNI field is
not sent in the TLS handshake.

Ref grpc#11784
@becomeStar becomeStar changed the title xds: Remove isXdsSniEnabled flag and update xDS SNI tests xds: Remove isXdsSniEnabled and align SNI logic with gRFC A101 Jan 25, 2026
Copy link
Contributor

@kannanjgithub kannanjgithub left a comment

Choose a reason for hiding this comment

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

Minor comment.

sniToUse = grpcHandler.getAuthority();
} else {
autoSniSanValidationDoesNotApply = false;
sniToUse = "";
Copy link
Contributor

Choose a reason for hiding this comment

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

This assignment is redundant.

Copy link
Contributor Author

@becomeStar becomeStar Feb 5, 2026

Choose a reason for hiding this comment

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

@kannanjgithub

Thanks for the review.

I’ve updated the change to remove the empty-string SNI handling and the associated test. It seemed that treating an empty string as a special case was no longer necessary, so I simplified the logic accordingly.

Please let me know if this looks reasonable to you.

Copy link
Contributor

@kannanjgithub kannanjgithub Feb 6, 2026

Choose a reason for hiding this comment

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

About the description, it mentions that is removing the fallback logic to the channel authoriy if the SNI isn't determined by the XDS configs. The reference to fallback sounds like the env guard GRPC_USE_CHANNEL_AUTHORITY_IF_NO_SNI_APPLICABLE. We are not removing this one yet. The flag GRPC_EXPERIMENTAL_XDS_SNI usage you have removed is for determining SNI using XDS configs at all times from now on. Can you edit the description to be more accurate?

Copy link
Contributor Author

@becomeStar becomeStar Feb 6, 2026

Choose a reason for hiding this comment

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

@kannanjgithub

Thanks for pointing that out.
I've updated the PR description to clarify that this change removes the
experimental xDS SNI guard and does not remove the
GRPC_USE_CHANNEL_AUTHORITY_IF_NO_SNI_APPLICABLE fallback.

Remove handling that propagated an empty string as SNI when no SNI
conditions were met.

With the legacy authority-based fallback removed, omitting SNI is the
intended behavior under gRFC A101. Relying on an empty string as an
intermediate representation is unnecessary and couples behavior to an
internal detail.

This also removes a test that asserted the empty-string SNI, as it no
longer reflects a stable or observable contract.
@kannanjgithub kannanjgithub added the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Feb 5, 2026
@kannanjgithub
Copy link
Contributor

/gcbrun

@grpc-kokoro grpc-kokoro removed the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Feb 5, 2026
@kannanjgithub kannanjgithub merged commit ac44e96 into grpc:master Feb 6, 2026
16 of 17 checks passed
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