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

GRPC client in .NET 5 run against 20.6.1 in insecure mode fails with "Request protocol 'HTTP/1.1' is not supported." #2707

Closed
Euphoric opened this issue Oct 4, 2020 · 6 comments · Fixed by EventStore/EventStore-Client-Dotnet#93
Labels
bug Issues which are a software defect

Comments

@Euphoric
Copy link

Euphoric commented Oct 4, 2020

To Reproduce

  1. Run Event Store 20.6.1 with --insecure flag
  2. Use Grpc client with TLS dissabled in application running in .NET 5

Code to reproduce: https://github.com/Euphoric/EventStoreHttpError

Expected behavior
Works correctly.

Actual behavior
Throws exception with "Request protocol 'HTTP/1.1' is not supported."

EventStore details

  • EventStore server version: 20.6.1

  • Operating system: Windows

  • EventStore client version (if applicable): 20.6.1 in .NET 5 (5.0.100-rc.1.20452.10)

Additional context
Works when run against 20.6.0 in Dev mode with TLS.
Works when run in .NET Core 3.1 against 20.6.1

I haven't found any mentions of .NET 5 breaking backwards compatibility of GRPC.

@Euphoric Euphoric added the bug Issues which are a software defect label Oct 4, 2020
@hayley-jean hayley-jean added this to the EventStoreDb 20.10 milestone Oct 5, 2020
@Euphoric
Copy link
Author

Euphoric commented Oct 5, 2020

I have verified this error doesn't happen when running against 20.6.1 with TLS enabled. So there must be something weird with the insecure mode.

@shaan1337
Copy link
Member

@Euphoric thanks for the report.

It is possible that the application is not setting the HTTP/2 prior knowledge mode properly.
Could you please try to set the following at the beginning of your main function and let us know if it works?

AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);

@Euphoric
Copy link
Author

Euphoric commented Oct 8, 2020

@shaan1337 Setting that doesn't change the behavior.

@jamiewinder
Copy link

jamiewinder commented Oct 13, 2020

I've just encountered this myself. Has anyone been able to figure out a workaround?

EDIT: I found this which gave me the clue to get this working. I just added the Grpc.Net.Client package to my project directly. It's a dependency of EventStore.Client.Grpc, but it was installing v2.29.0 for me, rather than the latest v2.32.0 which appears to fix the issue with the Http2UnencryptedSupport switch.

@Euphoric
Copy link
Author

I confirm that updating Grpc.Net.Client to 2.32.0 fixed this problem.

@mat-mcloughlin
Copy link
Contributor

Just ran into this myself

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues which are a software defect
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants