Skip to content

[xds] Implement gRFC A101#41051

Closed
murgatroid99 wants to merge 28 commits intogrpc:masterfrom
murgatroid99:xds_sni_support
Closed

[xds] Implement gRFC A101#41051
murgatroid99 wants to merge 28 commits intogrpc:masterfrom
murgatroid99:xds_sni_support

Conversation

@murgatroid99
Copy link
Copy Markdown
Member

This includes two major changes:

  1. An additional credentials option sni_override with the type optional<string>. If nullopt, it has no effect, and if set to the empty string it disables sending SNI entirely. Otherwise, the specified string will be sent.
  2. The implementation of gRFC A101 using that new option. This includes options to set SNI and to validate SAN values against the set SNI value.

Copy link
Copy Markdown
Member

@markdroth markdroth left a comment

Choose a reason for hiding this comment

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

This code looks really good overall!

I have a bunch of comments, but the vast majority of them are minor cosmetic things. Mainly waiting on the tests -- and I'm happy to chat about the best way to write those if you're having trouble with them.

Please let me know if you have any questions. Thanks!

Comment thread include/grpc/credentials.h Outdated
Comment thread src/core/credentials/transport/tls/grpc_tls_credentials_options.h
Comment thread src/core/credentials/transport/tls/tls_security_connector.cc Outdated
Comment thread src/core/credentials/transport/xds/xds_credentials.cc Outdated
Comment thread src/core/credentials/transport/xds/xds_credentials.cc Outdated
Comment thread src/core/xds/grpc/xds_cluster_parser.cc
Comment thread src/core/credentials/transport/xds/xds_credentials.cc Outdated
Comment thread src/core/xds/grpc/xds_cluster_parser.cc Outdated
Comment thread src/core/xds/grpc/xds_cluster.h Outdated
Comment thread src/core/xds/grpc/xds_cluster_parser.cc
@murgatroid99
Copy link
Copy Markdown
Member Author

I think I addressed all of the comments that I didn't respond to individually.

Copy link
Copy Markdown
Member

@markdroth markdroth left a comment

Choose a reason for hiding this comment

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

This is looking really good! As before, comments are mostly minor; the main missing thing is the e2e tests.

Please let me know if you have any questions. Thanks!

Comment thread src/core/credentials/transport/xds/xds_credentials.cc Outdated
Comment thread src/core/credentials/transport/xds/xds_credentials.h Outdated
Comment thread src/core/xds/grpc/xds_cluster.cc Outdated
Comment thread test/core/xds/xds_cluster_resource_type_test.cc Outdated
Comment thread test/core/xds/xds_cluster_resource_type_test.cc
Comment thread src/core/xds/grpc/xds_cluster.h Outdated

// Tls Context used by clients
CommonTlsContext common_tls_context;
UpstreamTlsContext upstream_tls_context;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Okay. Just please make sure there aren't any edge cases where the code that reads these new fields can't tell the difference between the TLS transport socket not being present and these fields not being set. I don't think there should be any such cases, but the ambiguity in the representation here makes me a little nervous.

Comment thread src/core/credentials/transport/xds/xds_credentials.cc Outdated
Comment thread src/core/credentials/transport/xds/xds_credentials.cc
Comment thread src/core/xds/grpc/xds_cluster_parser.cc
Copy link
Copy Markdown
Member

@markdroth markdroth left a comment

Choose a reason for hiding this comment

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

This is looking really good!

Comment thread include/grpc/credentials_cpp.h
Comment thread src/core/credentials/transport/xds/xds_credentials.cc Outdated
@murgatroid99
Copy link
Copy Markdown
Member Author

I added end2end tests, and they pass except for the Logical DNS test, which seems to be getting the wrong cert for some reason.

@markdroth
Copy link
Copy Markdown
Member

For future reference, please don't force-push to a branch once code review has started, since that makes it almost impossible for the reviewer to see what has changed since their last review pass. Thanks!

Copy link
Copy Markdown
Member

@markdroth markdroth left a comment

Choose a reason for hiding this comment

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

This is looking really good! Remaining comments are relatively minor.

Please let me know if you have any questions. Thanks!

Comment thread include/grpc/credentials_cpp.h
Comment thread test/cpp/end2end/xds/xds_security_end2end_test.cc Outdated
Comment thread test/cpp/end2end/xds/xds_security_end2end_test.cc Outdated
Comment thread test/cpp/end2end/xds/xds_security_end2end_test.cc Outdated
Comment thread test/cpp/end2end/xds/xds_security_end2end_test.cc Outdated
Comment thread test/cpp/end2end/xds/xds_security_end2end_test.cc Outdated
Comment thread test/cpp/end2end/xds/xds_security_end2end_test.cc Outdated
Comment thread test/cpp/end2end/xds/xds_security_end2end_test.cc Outdated
Comment thread test/cpp/end2end/xds/xds_security_end2end_test.cc Outdated
Comment thread test/cpp/end2end/xds/xds_security_end2end_test.cc Outdated
Copy link
Copy Markdown
Member

@markdroth markdroth left a comment

Choose a reason for hiding this comment

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

This looks great!

Remaining comments are minor; feel free to merge after addressing.

Comment thread test/cpp/end2end/xds/xds_security_end2end_test.cc Outdated
Comment thread test/cpp/end2end/xds/xds_security_end2end_test.cc Outdated
Comment thread test/cpp/end2end/xds/xds_security_end2end_test.cc Outdated
Copy link
Copy Markdown
Member

@markdroth markdroth left a comment

Choose a reason for hiding this comment

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

Looks great!

copybara-service Bot pushed a commit that referenced this pull request Jan 22, 2026
…41460)

This option was added to the core credentials API in #41051. Now we add the same option to the corresponding C++ API.

b/203822267

<!--

If you know who should review your pull request, please assign it to that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the appropriate
lang label.

-->

Closes #41460

COPYBARA_INTEGRATE_REVIEW=#41460 from murgatroid99:c++_creds_sni_override 7241f2a
PiperOrigin-RevId: 859620187
sergiitk pushed a commit to chadlwilson/grpc that referenced this pull request Jan 23, 2026
…rpc#41460)

This option was added to the core credentials API in grpc#41051. Now we add the same option to the corresponding C++ API.

b/203822267

<!--

If you know who should review your pull request, please assign it to that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the appropriate
lang label.

-->

Closes grpc#41460

COPYBARA_INTEGRATE_REVIEW=grpc#41460 from murgatroid99:c++_creds_sni_override 7241f2a
PiperOrigin-RevId: 859620187
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants