grpc / grpc/grpc-dotnet

gRPC HTTP-3 HTTP3 Kestrel .NET Client

Open
#2,328 2 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
C#
Stars
4.5k
Forks
836
Avg merge
6d 3h
Merged PRs (30d)
7

Description

Communication between the Kestrel Http-2 gRPC server and the .NET gRPC HttpClient is carried out smoothly.
However, communication between the Kestrel Http-3 gRPC server and the .NET gRPC HttpClient(`HttpVersion.Version30`) could not be achieved.

**Client:** ![image](https://github.com/grpc/grpc-dotnet/assets/81816237/081eab79-46c0-47c6-a169-5b18d1112783)

**Server:**
![image](https://github.com/grpc/grpc-dotnet/assets/81816237/cf0abbd5-13f2-4d15-a7d3-17e6e700ee91)
![image](https://github.com/grpc/grpc-dotnet/assets/81816237/3590d182-bac8-43af-b024-74a899fa2fe3)

[https://github.com/gradx/GrpcHttp3Net70Example/tree/main](https://github.com/gradx/GrpcHttp3Net70Example/tree/main)

I tried the project here but got the same error. Using `AllowAnyCertificate()` was suggested in the Issues section, but it did not work for me.

The error I get is:

```
Grpc.Core.RpcException: Status(StatusCode="Unavailable", Detail="Error starting gRPC call. HttpRequestException: No connection could be made because t...

Grpc.Core.RpcException
Status(StatusCode="Unavailable", Detail="Error starting gRPC call. HttpRequestException: No connection could be made because the target machine actively refused it. (127.0.0.1:5003) SocketException: No connection could be made because the target machine actively refused it.", DebugException="System.Net.Http.HttpRequestException: No connection could be made because the target machine actively refused it. (127.0.0.1:5003)
---> System.Net.Sockets.SocketException (10061): No connection could be made because the target machine actively refused it.
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
at System.Net.Sockets.Socket.g__WaitForConnectWithCancellation|281_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.AddHttp2ConnectionAsync(QueueItem queueItem)
at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.HttpConnectionWaiter`1.WaitForConnectionAsync(Boolean async, CancellationToken requestCancellationToken)
at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
at System.Net.Http.HttpClient.g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
at Grpc.Net.Client.Internal.GrpcCall`2.RunCall(HttpRequestMessage request, Nullable`1 timeout)")
at Http3GrpcUnitTest.UnitTest1.GrpcHttp3() in C:\Users\HP_\Downloads\GrpcHttp3Net70Example-main\GrpcHttp3Net70Example-main\Http3GrpcUnitTest\UnitTest1.cs:line 143
at Xunit.Sdk.TestInvoker`1.<>c__DisplayClass48_0.<b__1>d.MoveNext() in /_/src/xunit.execution/Sdk/Frameworks/Runners/TestInvoker.cs:line 264
--- End of stack trace from previous location ---
at Xunit.Sdk.ExecutionTimer.AggregateAsync(Func`1 asyncAction) in /_/src/xunit.execution/Sdk/Frameworks/ExecutionTimer.cs:line 48
at Xunit.Sdk.ExceptionAggregator.RunAsync(Func`1 code) in /_/src/xunit.core/Sdk/ExceptionAggregator.cs:line 90
```

Contributor guide

Open the contributing guide

Research direction

Start with the linked GrpcHttp3Net70Example reproduction and inspect Http3GrpcUnitTest/UnitTest1.cs at line 143, including the HttpVersion.Version30 client and Kestrel endpoint setup. Run the example and compare the configured endpoint with the connection-refused error; done means the .NET client successfully communicates with the Kestrel HTTP/3 gRPC server.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, grpc
Domain
backend-api-design, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.