Skip to content

Commit 8d31494

Browse files
authored
Merge pull request #37000 from dotnet/main
Merge to Live
2 parents ad707d4 + 47e342b commit 8d31494

File tree

2 files changed

+94
-13
lines changed

2 files changed

+94
-13
lines changed

aspnetcore/fundamentals/servers/kestrel/http3.md

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,18 @@
22
title: Use HTTP/3 with the ASP.NET Core Kestrel web server
33
ai-usage: ai-assisted
44
author: wtgodbe
5-
description: Learn about using HTTP/3 with Kestrel, the cross-platform web server for ASP.NET Core.
5+
description: "HTTP/3 support in Kestrel: Discover how to configure ASP.NET Core for HTTP/3, improve performance, and optimize your web server setup."
66
monikerRange: '>= aspnetcore-6.0'
7-
ms.author: wigodbe
8-
ms.custom: mvc, linux-related-content
9-
ms.date: 11/13/2025
7+
ms.author: wpickett
8+
ms.date: 04/14/2026
109
uid: fundamentals/servers/kestrel/http3
1110
---
1211

1312
# Use HTTP/3 with the ASP.NET Core Kestrel web server
1413

1514
[!INCLUDE[](~/includes/not-latest-version.md)]
1615

17-
:::moniker range=">= aspnetcore-8.0"
16+
:::moniker range=">= aspnetcore-11.0"
1817

1918
[HTTP/3](https://datatracker.ietf.org/doc/rfc9114/) is an approved standard and the third major version of HTTP. This article discusses the requirements for HTTP/3. HTTP/3 is fully supported in .NET 7 or later.
2019

@@ -46,28 +45,34 @@ The key differences from `HTTP/2` to `HTTP/3` are:
4645
* **Multiplexing**: While both support multiplexing, `HTTP/3`'s implementation with QUIC is more efficient and avoids the TCP-level head-of-line blocking issues.
4746
* **Connection Migration**: QUIC in `HTTP/3` allows connections to persist even when a client's IP address changes (like switching from Wi-Fi to cellular), improving mobile user experience.
4847

48+
## Early request processing
49+
50+
Kestrel can process HTTP/3 requests without first waiting for the control stream and the initial SETTINGS frame. This optimization reduces first-request latency on new HTTP/3 connections.
51+
52+
In ASP.NET Core versions earlier than .NET 11, Kestrel waited to receive the QUIC control stream and its initial SETTINGS frame before processing any request streams. This requirement is no longer necessary, which means the first request on a new connection completes faster.
53+
4954
## HTTP/3 requirements
5055

51-
HTTP/3 uses QUIC as its transport protocol. The ASP.NET Core implementation of HTTP/3 depends on [MsQuic](https://github.com/microsoft/msquic) to provide QUIC functionality. As a result, ASP.NET Core support of HTTP/3 depends on MsQuic platform requirements. For more information on how to install **MsQuic**, see [QUIC Platform dependencies](/dotnet/fundamentals/networking/quic/quic-overview#platform-dependencies). If the platform that Kestrel is running on doesn't have all the requirements for HTTP/3, then it's disabled, and Kestrel will fall back to other HTTP protocols.
56+
HTTP/3 uses QUIC as its transport protocol. The ASP.NET Core implementation of HTTP/3 depends on [MsQuic](https://github.com/microsoft/msquic) to provide QUIC functionality. As a result, ASP.NET Core support of HTTP/3 depends on MsQuic platform requirements. For more information on how to install **MsQuic**, see [QUIC Platform dependencies](/dotnet/fundamentals/networking/quic/quic-overview#platform-dependencies). If the platform that Kestrel is running on doesn't have all the requirements for HTTP/3, Kestrel disables HTTP/3 and falls back to other HTTP protocols.
5257

5358
## Getting started
5459

55-
HTTP/3 is not enabled by default. Add configuration to `Program.cs` to enable HTTP/3.
60+
HTTP/3 isn't enabled by default. Add configuration to `Program.cs` to enable HTTP/3.
5661

5762
:::code language="csharp" source="samples/6.x/KestrelSample/Snippets/Program.cs" id="snippet_Http3" highlight="7-8":::
5863

5964
The preceding code configures port 5001 to:
6065

6166
* Use HTTP/3 alongside HTTP/1.1 and HTTP/2 by specifying `HttpProtocols.Http1AndHttp2AndHttp3`.
62-
* Enable HTTPS with `UseHttps`. HTTP/3 requires HTTPS.
67+
* Enable HTTPS by using `UseHttps`. HTTP/3 requires HTTPS.
6368

64-
Because not all routers, firewalls, and proxies properly support HTTP/3, HTTP/3 should be configured together with HTTP/1.1 and HTTP/2. This can be done by specifying [`HttpProtocols.Http1AndHttp2AndHttp3`](xref:Microsoft.AspNetCore.Server.Kestrel.Core.HttpProtocols.Http1AndHttp2AndHttp3) as an endpoint's supported protocols.
69+
Because not all routers, firewalls, and proxies properly support HTTP/3, configure HTTP/3 together with HTTP/1.1 and HTTP/2. Specify [`HttpProtocols.Http1AndHttp2AndHttp3`](xref:Microsoft.AspNetCore.Server.Kestrel.Core.HttpProtocols.Http1AndHttp2AndHttp3) as an endpoint's supported protocols.
6570

6671
For more information, see <xref:fundamentals/servers/kestrel/endpoints>.
6772

6873
## Configure QuicTransportOptions
6974

70-
QUIC transport options can be configured by calling the <xref:Microsoft.AspNetCore.Hosting.WebHostBuilderQuicExtensions.UseQuic%2A> extension method on <xref:Microsoft.AspNetCore.Hosting.IWebHostBuilder>.
75+
Configure QUIC transport options by calling the <xref:Microsoft.AspNetCore.Hosting.WebHostBuilderQuicExtensions.UseQuic%2A> extension method on <xref:Microsoft.AspNetCore.Hosting.IWebHostBuilder>.
7176

7277
:::code language="csharp" source="samples/6.x/KestrelSample/Snippets/Program.cs" id="snippet_UseQuicWithOptions" highlight="3-8":::
7378

@@ -90,14 +95,16 @@ HTTP/3 is discovered as an upgrade from HTTP/1.1 or HTTP/2 via the [`alt-svc`](h
9095

9196
## Localhost testing
9297

93-
* Browsers don't allow self-signed certificates on HTTP/3, such as the Kestrel development certificate.
94-
* `HttpClient` can be used for localhost/loopback testing in .NET 6 or later. Extra configuration is required when using `HttpClient` to make an HTTP/3 request:
98+
* Browsers don't support self-signed certificates on HTTP/3, such as the Kestrel development certificate.
99+
* Use `HttpClient` for localhost or loopback testing in .NET 6 or later. When you use `HttpClient` to make an HTTP/3 request, you need extra configuration:
95100

96101
* Set [`HttpRequestMessage.Version`](xref:System.Net.Http.HttpRequestMessage.Version) to 3.0, or
97102
* Set [`HttpRequestMessage.VersionPolicy`](xref:System.Net.Http.HttpRequestMessage.VersionPolicy) to [`HttpVersionPolicy.RequestVersionOrHigher`](xref:System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher).
98103

99-
For more information on how to use HTTP/3 with `HttpClient`, see [HTTP/3 with .NET](/dotnet/core/extensions/httpclient-http3).
104+
For more information about how to use HTTP/3 with `HttpClient`, see [HTTP/3 with .NET](/dotnet/core/extensions/httpclient-http3).
100105

101106
:::moniker-end
102107

108+
[!INCLUDE[](~/fundamentals/servers/kestrel/includes/http3-8-10.md)]
109+
103110
[!INCLUDE[](~/fundamentals/servers/kestrel/includes/http3-6-7.md)]
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
:::moniker range=">= aspnetcore-8.0 < aspnetcore-11.0"
2+
3+
[HTTP/3](https://datatracker.ietf.org/doc/rfc9114/) is an approved standard and the third major version of HTTP. This article discusses the requirements for HTTP/3. HTTP/3 is fully supported in .NET 7 or later.
4+
5+
> [!IMPORTANT]
6+
> Apps configured to take advantage of HTTP/3 should be designed to also support HTTP/1.1 and HTTP/2.
7+
8+
## HTTP/3 benefits
9+
10+
`HTTP/3`:
11+
12+
* Is the latest version of the Hypertext Transfer Protocol.
13+
* Builds on the strengths of `HTTP/2` while addressing some of its limitations, particularly in terms of performance, latency, reliability, and security.
14+
15+
| Feature | `HTTP/2` | `HTTP/3` |
16+
|--------------|-------------------------------------------------------------|----------------------------------------------------------|
17+
| Transport | Uses [TCP](https://developer.mozilla.org/docs/Glossary/TCP) | Uses [QUIC](https://www.rfc-editor.org/rfc/rfc9000.html) |
18+
| Connection | Slower due to TCP + TLS | Combines transport and encryption handshakes |
19+
| Setup | handshake | handshakes |
20+
| Head-of-Line | Affected by TCP-level | Eliminated with QUIC |
21+
| Blocking | blocking | stream multiplexing |
22+
| Encryption | TLS over TCP | TLS is built into QUIC |
23+
24+
The key differences from `HTTP/2` to `HTTP/3` are:
25+
26+
* **Transport Protocol**: `HTTP/3` uses QUIC instead of TCP. QUIC offers improved performance, lower latency, and better reliability, especially on mobile and lossy networks.
27+
* **Head-of-Line Blocking**: `HTTP/2` can suffer from head-of-line blocking at the TCP level, where a delay in one stream can affect others. `HTTP/3`, with QUIC, provides independent streams, so packet loss in one stream doesn't stall others.
28+
* **Connection Establishment**: `HTTP/3` with QUIC can establish connections faster, as it combines transport and encryption handshakes.
29+
* **Encryption**: `HTTP/3` mandates TLS 1.3 encryption, providing enhanced security by default, whereas it's optional in `HTTP/2`.
30+
* **Multiplexing**: While both support multiplexing, `HTTP/3`'s implementation with QUIC is more efficient and avoids the TCP-level head-of-line blocking issues.
31+
* **Connection Migration**: QUIC in `HTTP/3` allows connections to persist even when a client's IP address changes (like switching from Wi-Fi to cellular), improving mobile user experience.
32+
33+
## HTTP/3 requirements
34+
35+
HTTP/3 uses QUIC as its transport protocol. The ASP.NET Core implementation of HTTP/3 depends on [MsQuic](https://github.com/microsoft/msquic) to provide QUIC functionality. As a result, ASP.NET Core support of HTTP/3 depends on MsQuic platform requirements. For more information on how to install **MsQuic**, see [QUIC Platform dependencies](/dotnet/fundamentals/networking/quic/quic-overview#platform-dependencies). If the platform that Kestrel is running on doesn't have all the requirements for HTTP/3, then it's disabled, and Kestrel will fall back to other HTTP protocols.
36+
37+
## Getting started
38+
39+
HTTP/3 is not enabled by default. Add configuration to `Program.cs` to enable HTTP/3.
40+
41+
:::code language="csharp" source="~/fundamentals/servers/kestrel/samples/6.x/KestrelSample/Snippets/Program.cs" id="snippet_Http3" highlight="7-8":::
42+
43+
The preceding code configures port 5001 to:
44+
45+
* Use HTTP/3 alongside HTTP/1.1 and HTTP/2 by specifying `HttpProtocols.Http1AndHttp2AndHttp3`.
46+
* Enable HTTPS with `UseHttps`. HTTP/3 requires HTTPS.
47+
48+
Because not all routers, firewalls, and proxies properly support HTTP/3, HTTP/3 should be configured together with HTTP/1.1 and HTTP/2. This can be done by specifying [`HttpProtocols.Http1AndHttp2AndHttp3`](xref:Microsoft.AspNetCore.Server.Kestrel.Core.HttpProtocols.Http1AndHttp2AndHttp3) as an endpoint's supported protocols.
49+
50+
For more information, see <xref:fundamentals/servers/kestrel/endpoints>.
51+
52+
## Configure QuicTransportOptions
53+
54+
QUIC transport options can be configured by calling the <xref:Microsoft.AspNetCore.Hosting.WebHostBuilderQuicExtensions.UseQuic%2A> extension method on <xref:Microsoft.AspNetCore.Hosting.IWebHostBuilder>.
55+
56+
:::code language="csharp" source="~/fundamentals/servers/kestrel/samples/6.x/KestrelSample/Snippets/Program.cs" id="snippet_UseQuicWithOptions" highlight="3-8":::
57+
58+
For the full list of available QUIC transport options and their descriptions, see <xref:Microsoft.AspNetCore.Server.Kestrel.Transport.Quic.QuicTransportOptions>.
59+
60+
## Alt-svc
61+
62+
HTTP/3 is discovered as an upgrade from HTTP/1.1 or HTTP/2 via the [`alt-svc`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Alt-Svc) header. That means the first request will normally use HTTP/1.1 or HTTP/2 before switching to HTTP/3. Kestrel automatically adds the `alt-svc` header if HTTP/3 is enabled.
63+
64+
## Localhost testing
65+
66+
* Browsers don't allow self-signed certificates on HTTP/3, such as the Kestrel development certificate.
67+
* `HttpClient` can be used for localhost/loopback testing in .NET 6 or later. Extra configuration is required when using `HttpClient` to make an HTTP/3 request:
68+
69+
* Set [`HttpRequestMessage.Version`](xref:System.Net.Http.HttpRequestMessage.Version) to 3.0, or
70+
* Set [`HttpRequestMessage.VersionPolicy`](xref:System.Net.Http.HttpRequestMessage.VersionPolicy) to [`HttpVersionPolicy.RequestVersionOrHigher`](xref:System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher).
71+
72+
For more information on how to use HTTP/3 with `HttpClient`, see [HTTP/3 with .NET](/dotnet/core/extensions/httpclient-http3).
73+
74+
:::moniker-end

0 commit comments

Comments
 (0)