.net Grpc Request protocol 'HTTP/1.1' is not supported

0

I've implemented a simple gRPC service in net5 similar to the GreeterService in the project template.

The service works fine when using IIS LocalHost but the client throws this exception when calling the remote server:

Grpc.Core.RpcException HResult=0x80131500 Message=Status(StatusCode="Internal", Detail="Request protocol 'HTTP/1.1' is not supported.")

I thought Grpc used HTTP/2 by default. What am I doing wrong ?

c#
.net
grpc
asked on Stack Overflow Feb 17, 2021 by jon morgan

1 Answer

0

Thanks for the responses. After reading this article I realized I needed to add the Grpc-Web proxy to my app, as this translates an HTTP/1.1 client message to HTTP/2.

The code additions to client and server are explained in this article.

After making these changes/additions my gRPC messaging service is working fine. Importantly - I spent a lot of time trying to figure out how to reference certificates in my call options - but the messaging works fine without a certificate.

answered on Stack Overflow Feb 18, 2021 by jon morgan

User contributions licensed under CC BY-SA 3.0