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

Created on 4 Oct 2020  路  6Comments  路  Source: EventStore/EventStore

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.

kinbug

Most helpful comment

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.

All 6 comments

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.

@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);

@shaan1337 Setting that doesn't change the behavior.

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.

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

Just ran into this myself

Was this page helpful?
0 / 5 - 0 ratings