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

Kestrel ListenUnixSocket #730

Closed
Zetanova opened this issue Jan 22, 2020 · 6 comments
Closed

Kestrel ListenUnixSocket #730

Zetanova opened this issue Jan 22, 2020 · 6 comments
Labels
question Further information is requested

Comments

@Zetanova
Copy link

I am desperately trying to get only a gRPC server over Unix socket to work
with opt.ListenUnixSocket("/mydir/mysocket.sock") to work.

Can it be that only Kestrel supports LinuxUnixSocket but not grpc-dotnet?

@Zetanova Zetanova added the question Further information is requested label Jan 22, 2020
@Zetanova
Copy link
Author

The socket is working,
but following error is thrown on connection: Microsoft.AspNetCore.Connections.ConnectionAbortedException: Invalid Host header: 'csi/csi.sock'

The client is a golang kubernetes from https://github.com/kubernetes-csi/node-driver-registrar
and kubelet is fails too. It tries with the absolut hostPath.

I tried { AllowedHosts: "*" } and without the setting and cant find anything to disable the Host header check.

@analogrelay
Copy link
Contributor

but following error is thrown on connection: Microsoft.AspNetCore.Connections.ConnectionAbortedException: Invalid Host header: 'csi/csi.sock'

This seems somewhat expected since / is not valid in an HTTP Host header. Since you're using a Unix socket, is it possible to configure your client to send a different Host header as a workaround? I'll file a matching bug on dotnet/aspnetcore to consider what we can do to be more generous in Kestrel.

@analogrelay
Copy link
Contributor

I tried { AllowedHosts: "*" } and without the setting and cant find anything to disable the Host header check.

To clarify a bit. The request is failing Host header validation, which is part of Kestrel and verifies if the Host header is valid according to the HTTP spec. The AllowedHosts setting is for validating that the Host header matches an expected set of values, so that's why setting AllowedHosts to * doesn't work.

@analogrelay
Copy link
Contributor

Filed dotnet/aspnetcore#18522

@Zetanova
Copy link
Author

seeing it only now and i filed now one too.
dotnet/aspnetcore#18533

@anure All kubernetes golang libs including the kubelet daemon itself are connection with the socket path in http2 authority header field.

I will try to setup an proxy container to override it as a workaround.

@JamesNK
Copy link
Member

JamesNK commented Jan 23, 2020

This isn't an issue in the .NET gRPC library. Lets centralize discussion at dotnet/aspnetcore#18522

@JamesNK JamesNK closed this as completed Jan 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants