skip to Main Content

I have a Blazor WASM Application that shall be hosted inside the Backend that is implemented using gRPC on ASP.NET with .NET 5.0. When I try to debug the WASM application and as soon as the debugging Browser starts I get this error:

fail: Microsoft.AspNetCore.Server.Kestrel[0]
  HTTP/2 over TLS was not negotiated on an HTTP/2-only endpoint.

All development certificates are installed and trusted and the websocket connection is established using wss:// scheme. So from my point of view the TLS negotiation should succeed.

I already found out that I can workaround that to a certain point by changing the Kestrel endpoint settings to use Http1AndHttp2 the problem then becomes that the gRPC connection from the frontend to the backend fails because of the downgrade to Http/1.

So my question is: Is there any option to debug Blazot WASM when using an Http/2 server on the hosting site?
If this is not possible: Can I determine somehow that the gRPC endpoints get delivered using HTTP/2 and the debugging endpoints via HTTP/1.1?

2

Answers


  1. Chosen as BEST ANSWER

    So the solution is quitq simple: I used the wrong package. When using Blazor with gRPC the Grpc.Client.Net.Web package must be used (as stated in this article: https://learn.microsoft.com/en-us/aspnet/core/grpc/browser?view=aspnetcore-6.0#configure-grpc-web-with-the-net-grpc-client).

    Then you do not have to use HTTP/2 and everything works like a charm.


  2. Here are some tips for checking TLS negotiation limitation on Http/2:

    1. TLS version 1.2 or later
    2. Renegotiation disabled
    3. Compression disabled
    4. Minimum ephemeral key exchange sizes:
      • Elliptic curve Diffie-Hellman (ECDHE) [RFC4492]: 224 bits minimum
      • Finite field Diffie-Hellman (DHE) [TLS12]: 2048 bits minimum
    5. Cipher suite not prohibited.
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search