-
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
Interceptor + TLS auth combination broken after 4d266? #700
Comments
Running with debug logging produces the following output:
So it looks like it connects, but the server sends an internal error? I'm using an empty interceptor to test, and it works fine without it, i.e.
Here's what happens on the server:
Googling for this last error, it seems to match stepancheg/grpc-rust#105, and the server is also a Python one. |
I'm looking at https://github.com/hyperium/tonic/blob/master/tonic/src/client/grpc.rs#L252 and it seems the right headers are set for compatibility with python servers. |
Are you able to provide an example script that reproduces the error? |
Good news, I've found the issue :)
It works fine when removing the sanitization, but there is probably a more elegant solution. |
I'm still not sure I get what the actual issue is. I tried applying interceptors to the tls-client-auth examples but they both work fine. Are you able to provide a reproduction script? |
Try to print the request in tonic/tonic/src/transport/channel/mod.rs Line 189 in e199387
The headers (that are necessary to interact with a Python server). get dropped because of the |
Ah yeah I see. All the talk about TLS made it seem like the problem was something else. I'll look into it, shouldn't be hard to fix. |
`InterceptedService` would previously use `tonic::Request::into_http` which removes reserved headers. That mean inner middleware in the stack wouldn't be able to see those headers, which could result in errors. Fixes #700
`InterceptedService` would previously use `tonic::Request::into_http` which removes reserved headers. That mean inner middleware in the stack wouldn't be able to see those headers, which could result in errors. Fixes #700
It does, thanks a lot for the quick fix! |
`InterceptedService` would previously use `tonic::Request::into_http` which removes reserved headers. That mean inner middleware in the stack wouldn't be able to see those headers, which could result in errors. Fixes #700
Bug Report
Version
Commits after 4d2667d (not released yet)
Platform
Linux 5.12.13-arch1-2 #1 SMP PREEMPT Fri, 25 Jun 2021 22:56:51 +0000 x86_64 GNU/Linux
Description
I have a simple client with TLS auth (as in https://github.com/hyperium/tonic/tree/master/examples/src/tls_client_auth) and an authentication with interception (as in https://github.com/hyperium/tonic/tree/master/examples/src/authentication).
It works great on 0.4.3.
With 4d2667d, I get the error mentioned in #678, fixed in 2ba0889.
On this latter commit and the next ones, I however get an "Unknown gRPC error" when making a request with the created client. Depending on the commit, it shows as a "transport error" or an "h2 error" (I see that there were some changes in the mapping.
Removing the interceptor (but keeping the TLS auth works fine).
Is it possible that 4d266 broke the interceptor + TLS auth combination?
The text was updated successfully, but these errors were encountered: