Events
Power BI DataViz World Championships
Feb 14, 4 PM - Mar 31, 4 PM
With 4 chances to enter, you could win a conference package and make it to the LIVE Grand Finale in Las Vegas
Learn moreThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
This isn't the latest version of this article. For the current release, see the .NET 9 version of this article.
Warning
This version of ASP.NET Core is no longer supported. For more information, see the .NET and .NET Core Support Policy. For the current release, see the .NET 9 version of this article.
Important
This information relates to a pre-release product that may be substantially modified before it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
For the current release, see the .NET 9 version of this article.
By Chris Ross
HTTP/3 is fully supported with ASP.NET Core in the following IIS scenarios:
For more information on the in-process and out-of-process hosting models, see ASP.NET Core Module (ANCM) for IIS.
The following requirements also need to be met:
https
url binding is used.For an in-process deployment when an HTTP/3 connection is established, HttpRequest.Protocol
reports HTTP/3
. For an out-of-process deployment when an HTTP/3 connection is established, HttpRequest.Protocol
reports HTTP/1.1
because that is how IIS proxies the requests to Kestrel.
HTTP/3 is discovered as an upgrade from HTTP/1.1 or HTTP/2 via the alt-svc
header. That means the first request will normally use HTTP/1.1 or HTTP/2 before switching to HTTP/3. IIS doesn't automatically add the alt-svc
header, it must be added by the application. The following code is a middleware example that adds the alt-svc
response header.
app.Use((context, next) =>
{
context.Response.Headers.AltSvc = "h3=\":443\"";
return next(context);
});
Place the preceding code early in the request pipeline.
IIS also supports sending an AltSvc HTTP/2 protocol message rather than a response header to notify the client that HTTP/3 is available. See the EnableAltSvc registry key. Note this requires netsh sslcert bindings that use host names rather than IP addresses.
HTTP/3 is supported with ASP.NET Core in the following IIS deployment scenarios:
For more information on the in-process and out-of-process hosting models, see ASP.NET Core Module (ANCM) for IIS.
The following requirements also need to be met:
https
url binding is used.For an in-process deployment when an HTTP/3 connection is established, HttpRequest.Protocol
reports HTTP/3
. For an out-of-process deployment when an HTTP/3 connection is established, HttpRequest.Protocol
reports HTTP/1.1
because that is how IIS proxies the requests to Kestrel.
HTTP/3 is discovered as an upgrade from HTTP/1.1 or HTTP/2 via the alt-svc
header. That means the first request will normally use HTTP/1.1 or HTTP/2 before switching to HTTP/3. IIS doesn't automatically add the alt-svc
header, it must be added by the application. The following code is a middleware example that adds the alt-svc
response header.
app.Use((context, next) =>
{
context.Response.Headers.AltSvc = "h3=\":443\"";
return next(context);
});
Place the preceding code early in the request pipeline.
IIS also supports sending an AltSvc HTTP/2 protocol message rather than a response header to notify the client that HTTP/3 is available. See the EnableAltSvc registry key. Note this requires netsh sslcert bindings that use host names rather than IP addresses.
ASP.NET Core feedback
ASP.NET Core is an open source project. Select a link to provide feedback:
Events
Power BI DataViz World Championships
Feb 14, 4 PM - Mar 31, 4 PM
With 4 chances to enter, you could win a conference package and make it to the LIVE Grand Finale in Las Vegas
Learn more