-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Relax authority strictness for interoperability with other (existing) clients #243
Comments
Yeah, I think this issue would be better to be filed in |
@LucioFranco Thank you for your swift reply! I also thought that that would be the case, I'll ask there as well thanks again. |
@gila do you have any workaround for this? (Facing the same issue now) |
Hi @saschagrunert, So the good news is -- that the grpc-go folks have fixed the problem of setting an empty authority header. The problem is, and depending on your use case, I have no idea when that will land in any of the containers/distro's you might be using. So in the meantime, I've patched h2 to set it for us when it is empty. Doing so we were able to implement a CSI driver with tonic just fine. It's ugly, but it works. Perhaps for the time being you can do something similar to unblock your self. Below the hack, I applied for your convenience. Depending on the exact version of h2/tonic you are using it might be a bit different for the current version, this is against h2 0.2.6 IIRC.
|
Thank you for the quick reply @gila ❤️
Do you have a PR at hand where this got merged? 😇 |
I still get the same error even if I apply the patch to tools like crictl:
Edit: With the latest tonic master it seems to work. |
Feature Request
During the implementation of a CSI driver, and working with existing gRPC clients that require a UDS socket, all requests are failed with reason=PROTOCOL_ERROR.
Here is an example when testing the "Identity" service of such a driver:
From the server-side of things with RUST_LOG set to trace we can see:
So the problem is pretty clear straight from here. We are sending an invalid (in context from HTTP for sure) an invalid authority and we error out at https://github.com/hyperium/http/blob/master/src/uri/authority.rs#L96
So in principle, the system works as designed. However according to RFC-3986:
Unfortunately, it seems to be the case that google, instead of using the "file://" scheme has invented its own scheme "unix://" there is a known issue for this filed here: grpc/grpc-go#2628
Regardless of the scheme used here it still would not work as the only scheme considered (and it looks to be implicit) is the http scheme, which makes sense as h2 states to be an HTTP server.
Currently, the way to we work around this is to patch h2 but this is suboptimal, and I can imagine other users might run into this problem as well. Although the problem itself simple, finding the right solution is not as the h2 crate and the HTTP crate are written to deal with HTTP.
Motivation
Would like to use tonic without the need to patch h2 or http
Proposal
Find an away to change/register handlers for schemes other than the http:// scheme or at least support unix:// and/or file:// ?
The text was updated successfully, but these errors were encountered: