-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
XDS configured client not setting :authority for TLS handshake #11750
Comments
I responded to your email on the grpc-io list. In short, you need to use XdsChannelCredentials. Since you mention SNI here, it seems that may not be implemented; A29 says it is ignored.
gRFC A81 isn't fully implemented yet. None of it was in 1.69. In 1.70 it may be limping enough to look like it works, but it is known to be incomplete and it hasn't been fully tested. That's why it can only be enabled with an undocumented flag (yes, it is in the gRFC, but hasn't been documented for Java). |
Hi @ejona86, I tried setting the XdsChannelCredentials like so:
and like gRFC A29 described I set
Of course when I added that
And this is the same connection reset error:
I also tried this with 1.70.0-SNAPSHOT that I build locally and the same problem exists. Note that I've enable auto_rewrite_host from gRFC A81 but that doesn't solve the problem yet although manually setting If I understand you correctly this is probably just not implemented yet, is that correct? If so, do you have a timeframe for when this might be implemented? Thanks |
Just to add some more context, I was able to patch grpc code to make this work but I'm pretty sure it's not the correct fix but I wanted to share it anyway. Basically in the ClusterImplLoadBalancer I've set the Here is an my code:
Ideally I think the SNI value should be sourced from the |
:-/ Looks like there's a bug. When using XdsChannelCredentials, SNI should be disabled. But the way it is delegating to the normal implementation means the implementation knows the regular authority and passes it to the SSLEngine. That's what powers SNI. |
@ejona86 not sure why you say SNI should be disable when using XdsChannelCredentials, is it because gRFC A29 says the Since the What is the process to have a gRFC created to add SNI support when enabling xds-tls-security as decribed in gRFC 29? |
Since Making the gRFC is only part of it; it would also require implementation work. A gRFC is not "please implement this for me" but "here is what I will implement." Because of this issue and me noticing SNI was not supported, I've been asking around to see if others actually need SNI for other reasons soon. |
@ejona86 thanks for looking into the |
What version of gRPC-Java are you using?
<grpc.version>1.69.0</grpc.version>
What is your environment?
macOS 15.1.1
What did you expect to see?
When using grpc-java client with XDS configuration I was expecting the client request to succeed but instead it failed. The only way the client application will work is when I manually set the authority via
channelBuilder.overrideAuthority()
, but doing this doesn't seem to make sense since the GRPC client now needs to know something I feel should have been provided in the XDS response with the endpoints.Note that I've enabled:
trusted_xds_server
server feature in the bootstrap.jsonGRPC_EXPERIMENTAL_XDS_AUTHORITY_REWRITE
to trueauto_host_rewrite: true
in the RouteMatch for that virtual host.Since this GRPC server is behind an envoy that is handling multiple TLS certificates the SNI information needs to be sent via the TLS handshake, and I think that is what may be happening here. Is there something that I need to do in order to send
:authority
as SNI info either in the XDS response or during the ManagedChannel setup?What did you see instead?
Steps to reproduce the bug
my bootstrap.json looks like this:
This is the ADS response from the XDS server:
Listener
RouteConfiguration
Clusters
Endpoints
The text was updated successfully, but these errors were encountered: