0

I'm implementing gRPC server using NET 6 C# and try to add QUIC protocol

services.Configure<KestrelServerOptions>(serverOptions =>
{
       serverOptions.ListenAnyIP(900, o =>
       {
           o.Protocols = HttpProtocols.Http1AndHttp2AndHttp3;
           o.UseHttps();
      });
            
     serverOptions.ListenAnyIP(890, o =>
     {
           o.Protocols = HttpProtocols.Http3;
           o.UseHttps();
     });   
});

Server deployed on Amazon linux. sudo yum install -y libmsquic was started. But I'm receiving exception as below

Unhandled exception. System.InvalidOperationException: This platform doesn't support QUIC or HTTP/3.
   at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerImpl.<>c__DisplayClass30_0`1.<<StartAsync>g__OnBind|0>d.MoveNext()

Please suggest, what I'm missing?

Guru Stron
  • 102,774
  • 10
  • 95
  • 132
Valery Yegorov
  • 171
  • 1
  • 11
  • HTTP/3 is available in .NET 6 as a preview feature. The HTTP/3 specification isn't finalized and behavioral or performance issues may exist in HTTP/3 with .NET 6. Apps configured to take advantage of HTTP/3 should be designed to also support HTTP/1.1 and HTTP/2. https://learn.microsoft.com/en-us/aspnet/core/fundamentals/servers/kestrel/http3?view=aspnetcore-6.0 – D A Sep 16 '22 at 08:52

1 Answers1

0

Microsoft documentation says NET 6 is only compatible with the 1.9.x versions of libmsquic. Libmsquic 2.x is not compatible due to breaking changes. Libmsquic receives updates to 1.9.x when needed to incorporate security fixes.

sudo yum install -y libmsquic-1.9*

Additional using o.Protocols = HttpProtocols.Http3; Kestrel don't open port. I.e. we need HttpProtocols.Http1AndHttp2AndHttp3;

Valery Yegorov
  • 171
  • 1
  • 11
  • You have to add MS packages before you can install libmsquic-1.9*. Link at https://learn.microsoft.com/en-us/windows-server/administration/linux-package-repository-for-microsoft-software – thangchung Sep 30 '22 at 04:51