GRPC :scheme pseudo-header passed from proxy/loadbalancer causes ConnectionAbortedException
See original GitHub issueDescribe the bug
Grpc kestrel .net 5 sample app greeter is running in k8s under http transport, an AWS network load balancer terminates SSL and sends request to the app with :scheme pseudo-header set to “https”, but the actual transport is “http” results in this error -
Trace id "0HM6QO8HEK1N9:00000001": HTTP/2 stream error "PROTOCOL_ERROR". A Reset is being sent to the stream. Microsoft.AspNetCore.Connections.ConnectionAbortedException: The request :scheme header 'https' does not match the transport scheme 'http'.
The ask here is to be less stringent on validating on the :schema pseudo header, Go lang sample apps works fine.
To Reproduce
Deploy any sample grpc app from here - https://github.com/grpc/grpc-dotnet/tree/master/examples to k8s, setup the service type loadbalancer using AWS NLB. Test with grpcurl client.
Exceptions (if any)
Microsoft.AspNetCore.Connections.ConnectionAbortedException: The request :scheme header 'https' does not match the transport scheme 'http'.
Further technical details
- ASP.NET Core version
- Include the output of
dotnet --info - The IDE (VS / VS Code/ VS4Mac) you’re running on, and its version
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:41 (21 by maintainers)

Top Related StackOverflow Question
PSA for google cloud run users, google actually fixed this issue on their side
https://issuetracker.google.com/issues/187470251?pli=1
This recently broke me in Cloud Run, I guess GCP updated envoy because it was working fine a couple of weeks ago. Here’s a workaround if anyone needs it:
git clone https://github.com/dotnet/aspnetcore.git && cd aspnetcore && git checkout tags/v5.0.5git submodule update --init --recursive/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Stream.csand comment out lines 244-250. If not version 5.0.5, it’s the block of code that starts withif (!ReferenceEquals(headerScheme, Scheme) &&, comment that whole if block./build.sh --configuration Releasein the root of the project. It had a few errors but the file I needed was built.aspnetcore/artifacts/bin/Microsoft.AspNetCore.Server.Kestrel.Core/Release/net5.0/Microsoft.AspNetCore.Server.Kestrel.Core.dlland copy it to a folder with the following Dockerfile:A bit of a pain, but we’re back up on Cloud Run with this …