gRPC connection error: "Error starting gRPC call. HttpRequestException: Requesting HTTP version 2.0 with version policy RequestVersionExact while unable to establish HTTP/2 connection."

Eric Brandt 45 Reputation points
2024-11-22T16:12:04.1466667+00:00

Hello! Can you suggest what might be the source (And remedy) for this error that occurs on certain PCs in our organization, but not others?

System.Exception: Unable to establish connection because Rpc error 'Internal': Status(StatusCode="Internal", Detail="Error starting gRPC call. HttpRequestException: Requesting HTTP version 2.0 with version policy RequestVersionExact while unable to establish HTTP/2 connection.", DebugException="System.Net.Http.HttpRequestException: Requesting HTTP version 2.0 with version policy RequestVersionExact while unable to establish HTTP/2 connection.")

The only relevant related answer I found online was:

https://stackoverflow.com/questions/66500195/net-5-grpc-client-call-throws-exception-requesting-http-version-2-0-with-versi

But it is a bit old, and perhaps a lot has changed since then. We are using .NET 8 and Grpc.Net.Client 2.66.0. We are using http:// (not https://)

On the client side, the only thing we are doing before establishing connection is:

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

On the server side, this is the relevant server initialization (C++)

ServerBuilder builder;
builder.AddListeningPort(server_address, grpc::InsecureServerCredentials());
// ... continue with registering service, building, and starting

Any help you can provide in troubleshooting this issue would be appreciated. Thanks!

Remote Desktop
Remote Desktop
A Microsoft app that connects remotely to computers and to virtual apps and desktops.
4,732 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 71,696 Reputation points
    2024-11-22T17:33:27.89+00:00

    does your network support http2? not only does the client O/S and server O/S need to support, but any firewall or proxies between must also support http2.


  2. Romario Arnat 25 Reputation points
    2025-02-25T14:22:21.4966667+00:00

    so i have run into a similar situation, i also have .NET 8 and Grpc.Net.Client 2.66.0

    I don't know if it makes a difference, but the error gets triggered for me when I make a Firebase call.

    have you been able to track down the issue?

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.