ASP.NET Core 3.0 app not working on Windows Server 2012 R2 due to ERR_HTTP2_INADEQUATE_TRANSPORT_SECURITY

ASP.NET Core 3.0 app not working on Windows Server 2012 R2 due to ERR_HTTP2_INADEQUATE_TRANSPORT_SECURITY

If your ASP.NET Core 3.0 app is not working on Windows Server 2012 R2 due to ERR_HTTP2_INADEQUATE_TRANSPORT_SECURITY, it is likely because the server does not support the required transport security protocol.

To fix this issue, you can disable HTTP/2 on the server and revert to using HTTP/1.1. Here's how you can do it:

  1. Open the appsettings.json file in your ASP.NET Core project.

  2. Add the following line to the file:

    "Kestrel": { "EndpointDefaults": { "Protocols": "Http1" } } 

    This will configure Kestrel (the web server used by ASP.NET Core) to use HTTP/1.1 instead of HTTP/2.

  3. Save the appsettings.json file and rebuild your ASP.NET Core project.

  4. Publish the project to a folder.

  5. Copy the published files to the Windows Server 2012 R2 machine.

  6. Navigate to the published folder in command prompt and run the following command:

    dotnet YourProjectName.dll 

    Replace YourProjectName with the name of your project.

  7. Visit your application in a web browser, and it should now work without the ERR_HTTP2_INADEQUATE_TRANSPORT_SECURITY error.

Disabling HTTP/2 is not an ideal solution, as HTTP/2 provides performance improvements over HTTP/1.1. If possible, it is recommended to upgrade the server to a version that supports the required transport security protocol.

Examples

  1. "ASP.NET Core 3.0 HTTP/2 inadequate transport security"

    • Code Implementation:
      <PropertyGroup> <AspNetCoreModuleHostingModel>OutOfProcess</AspNetCoreModuleHostingModel> </PropertyGroup> 
    • Description: Adds <AspNetCoreModuleHostingModel> property to the project file, setting it to OutOfProcess to resolve HTTP/2 issues.
  2. "Windows Server 2012 R2 ERR_HTTP2_INADEQUATE_TRANSPORT_SECURITY"

    • Code Implementation:
      services.AddHttpsRedirection(options => { options.HttpsPort = 443; }); 
    • Description: Configures HTTPS redirection in ConfigureServices method to ensure secure transport.
  3. "ASP.NET Core 3.0 Windows Server 2012 R2 HTTP2 issues"

    • Code Implementation:
      public void Configure(IApplicationBuilder app, IHostingEnvironment env) { app.Use(async (context, next) => { context.Request.Scheme = "https"; await next(); }); // Other middleware configurations } 
    • Description: Manually sets the request scheme to "https" in the Configure method to address HTTP2 issues.
  4. "Windows Server 2012 R2 ASP.NET Core 3.0 ERR_HTTP2_INADEQUATE_TRANSPORT_SECURITY"

    • Code Implementation:
      services.AddMvc(options => { options.EnableEndpointRouting = false; }); 
    • Description: Disables endpoint routing in ConfigureServices to resolve issues with HTTP2 on Windows Server 2012 R2.
  5. "HTTP2 inadequate transport security ASP.NET Core 3.0"

    • Code Implementation:
      <PropertyGroup> <AspNetCoreModuleHostingModel>OutOfProcess</AspNetCoreModuleHostingModel> <UseIISIntegration>false</UseIISIntegration> </PropertyGroup> 
    • Description: Adds <UseIISIntegration> property to the project file, setting it to false, and specifies OutOfProcess hosting to resolve HTTP2 issues.
  6. "Windows Server 2012 R2 ASP.NET Core 3.0 HTTP2 cipher suites"

    • Code Implementation:
      <PropertyGroup> <AspNetCoreModuleHostingModel>OutOfProcess</AspNetCoreModuleHostingModel> <UseIISIntegration>false</UseIISIntegration> <KestrelServerLimits_MaxConcurrentConnections>100</KestrelServerLimits_MaxConcurrentConnections> <KestrelServerLimits_MaxConcurrentUpgradedConnections>100</KestrelServerLimits_MaxConcurrentUpgradedConnections> </PropertyGroup> 
    • Description: Specifies Kestrel server limits in the project file to address issues with HTTP2 on Windows Server 2012 R2.
  7. "ASP.NET Core 3.0 Windows Server 2012 R2 TLS settings"

    • Code Implementation:
      services.AddHttpsRedirection(options => { options.HttpsPort = 443; options.RedirectStatusCode = StatusCodes.Status307TemporaryRedirect; }); 
    • Description: Configures HTTPS redirection with specific settings in ConfigureServices to resolve transport security issues.
  8. "Windows Server 2012 R2 ASP.NET Core 3.0 HTTP2 cipher suite configuration"

    • Code Implementation:
      services.AddHttpsRedirection(options => { options.HttpsPort = 443; options.SslProtocols = SslProtocols.Tls12; }); 
    • Description: Configures HTTPS redirection with specific SSL protocols in ConfigureServices to address HTTP2 cipher suite configuration.
  9. "ASP.NET Core 3.0 Windows Server 2012 R2 TLS version"

    • Code Implementation:
      services.Configure<IISServerOptions>(options => { options.MinRequestBodyDataRate = new MinDataRate(100, TimeSpan.FromSeconds(10)); }); 
    • Description: Configures minimum request body data rate in ConfigureServices to address issues with TLS versions on Windows Server 2012 R2.
  10. "Windows Server 2012 R2 ASP.NET Core 3.0 HTTP2 support"

    • Code Implementation:
      <PropertyGroup> <AspNetCoreModuleHostingModel>OutOfProcess</AspNetCoreModuleHostingModel> <UseIISIntegration>false</UseIISIntegration> <KestrelServerLimits_MaxRequestBodySize>104857600</KestrelServerLimits_MaxRequestBodySize> </PropertyGroup> 
    • Description: Specifies maximum request body size in the project file to address issues with HTTP2 support on Windows Server 2012 R2.

More Tags

resolve html-escape-characters webpacker title cors-anywhere launching-application ninject android-data-usage intel-mkl mysql-5.0

More C# Questions

More Fitness-Health Calculators

More Financial Calculators

More Retirement Calculators

More Gardening and crops Calculators