Skip to content
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

HTTP/2 error: Stream error: Stream was terminated by peer (errorCode: 1) when using Unix sockets on OSX #576

Closed
denizt opened this issue Sep 8, 2022 · 4 comments · Fixed by #577

Comments

@denizt
Copy link

denizt commented Sep 8, 2022

All gRPC calls fail when using UNIX sockets on mullvad-daemon

grpc: 3.0.2

Repro steps

  1. Get the example project attached
  2. pub get
  3. Execute unix_client

Expected result: TunnelState indicating the state of the VPN

Actual result: HTTP/2 error: Stream error: Stream was terminated by peer (errorCode: 1)

Details

Might be related to #572
The server is built with https://github.com/hyperium/tonic and works as expected for both rust and grpc-python

mullvad_daemon_test.zip

@faern
Copy link

faern commented Sep 8, 2022

The server also works as expected with a gprc-js client, as that's what the GUI frontend is using. https://github.com/mullvad/mullvadvpn-app/blob/dca39b225e54eecc2309bff371e7f6c5262f5203/gui/src/main/daemon-rpc.ts#L1

@mraleph
Copy link
Member

mraleph commented Sep 8, 2022

mullvad_daemon_test.zip

Could you please put your reproduction into some github/gitlab repo and license it under some open-source license of your choice? We can't look at any code that does not have a clear license unfortunately.

denizt added a commit to denizt/grpc-dart that referenced this issue Sep 8, 2022
@denizt
Copy link
Author

denizt commented Sep 8, 2022

Sure, added it to the examples in the fork https://github.com/denizt/grpc-dart/tree/mullvad-testcase/example

Same license as the repo, Apache-2.0

@mraleph
Copy link
Member

mraleph commented Sep 8, 2022

I took a quick look. Enabling verbose logging on the server side reveals that it (rightfully so) does not like authority field which grpc-dart sends. You can work-around by doing ChannelCredentials.insecure(authority: 'localhost').

I will make PR which would make grpc-dart default to localhost authority when connecting over UDS.

mraleph added a commit that referenced this issue Sep 8, 2022
We were using path to the UDS socket itself, which is incorrect `:authority` value. 

This was tripping checks in some HTTP2 protocol implementations.

Instead default `:authority` to `localhost`, which in line with other gRPC implementations.

Fixes #576
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 a pull request may close this issue.

3 participants