question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to disable HTTP2 in Blazor Server

See original GitHub issue

The proposed solution to my previous problem (#15123 ) was to disable HTTP2. To do so, I’m using the following Program.cs code:

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;

namespace Sel.Automate.WebAppServer
{
    public static class Program
    {
        public static void Main(string[] args)
        {
            CreateHostBuilder(args).Build().Run();
        }

        public static IHostBuilder CreateHostBuilder(string[] args) =>
            Host.CreateDefaultBuilder(args)
                .ConfigureWebHostDefaults(webBuilder =>
                {
                    webBuilder.UseStartup<Startup>();
                });

        public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
            WebHost.CreateDefaultBuilder(args)
                .ConfigureKestrel((context, options) =>
                {
                    // Disable HTTP/2
                    // If it's only your development machines that have this problem, you can wrap
                    // this in `if (context.HostingEnvironment.IsDevelopment())` or some other condition
                    // that is only true in development.
                        options.Listen(IPAddress.Loopback, 5001, listenOptions =>
                        {
                            listenOptions.Protocols = Microsoft.AspNetCore.Server.Kestrel.Core.HttpProtocols.Http1;
                        });
                });
    }
}

Both FF/GC are still not able to load the Blazor Server example due to ERR_HTTP2_INADEQUATE_TRANSPORT_SECURITY. Any thoughts? Thanks!

OS: Windows 10.0.17763 Build 17763

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Tratchercommented, Oct 23, 2019

Or here’s an easier option, update your appsettings.json like this:

{
  "Logging": {
    "LogLevel": {
      "Default": "Warning",
      "Microsoft.Hosting.Lifetime": "Information"
    }
  },
  "AllowedHosts": "*",
  "Kestrel": {
    "EndpointDefaults": {
      "Protocols": "Http1"
    }
  }
}
0reactions
javiercncommented, Oct 23, 2019

Closing this issue as there’s no more action for us to take here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to disable HTTP2 in Blazor Server · Issue #15268
The proposed solution to my previous problem (#15123 ) was to disable HTTP2. To do so, I'm using the following Program.cs code: using...
Read more >
How to enable HTTP2 in Kestrel - asp.net
In my local Windows 10 and Windows Server 2019 VPS HTTPS works fine, only HTTP2 is not available. In Windows 11 of another...
Read more >
Use ASP.NET Core with HTTP/2 on IIS
Learn how to use HTTP/2 features with IIS.
Read more >
HTTP.sys web server implementation in ASP.NET Core
HTTP/2 is enabled by default. If an HTTP/2 connection isn't established, the connection falls back to HTTP/1.1. In a future release of Windows, ......
Read more >
Protocols in ASP .NET Core: HTTPS and HTTP/2
This week, we'll be looking at the use of HTTPS in ASP .NET Core projects (using HTTP/1.1 today) and also HTTP/2 support for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found