Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP2 scenario coverage #8519

Merged
merged 7 commits into from
Sep 17, 2018
Merged

HTTP2 scenario coverage #8519

merged 7 commits into from
Sep 17, 2018

Conversation

guardrex
Copy link
Collaborator

@guardrex guardrex commented Sep 13, 2018

Fixes #7161

Internal Review Topic (Servers landing page)
Internal Review Topic (Kestrel)
Internal Review Topic (HTTP.sys)
Internal Review Topic (IIS)
Internal Review Topic (Linux Nginx)
Internal Review Topic (Linux Apache)

No doubt in need of corrections and additions. I still had to guess on a few items, but it should be easy to sort these spots out on review.

Opened Add API links to HTTP/2 content #8518 to update the API references to links.

@guardrex guardrex changed the title HTTP2 scenario coverage [WIP] HTTP2 scenario coverage Sep 13, 2018
@guardrex guardrex added the WIP label Sep 13, 2018
Updates

Updates

Updates

JSON fixes

Updates

Updates
@guardrex guardrex changed the title [WIP] HTTP2 scenario coverage HTTP2 scenario coverage Sep 16, 2018
@guardrex guardrex removed the WIP label Sep 16, 2018
@guardrex guardrex requested a review from Tratcher September 16, 2018 15:54
* [Application-Layer Protocol Negotiation (ALPN)](https://tools.ietf.org/html/rfc7301#section-3) connection
* TLS 1.2 or later connection

If an HTTP/2 connection is established, [HttpRequest.Protocol](xref:Microsoft.AspNetCore.Http.HttpRequest.Protocol*) reports `HTTP/2`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is new in 2.2. prior versions reported http/1.1 even for http/2 requests.

```csharp
.ConfigureKestrel((context, options) =>
{
options.Limits.MaxStreamsPerConnection = 100;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Limits.Http2.* for all of these new ones.


The `Protocols` property establishes the HTTP protocols (`HttpProtocols`) enabled on a connection endpoint or for the server. Assign a value to the `Protocols` property from the `HttpProtocols` enum.

| `HttpProtocols` enum value | Connection protocol permitted |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tls restrictions:
Http1 - can be used with or without tls
Http2 - primarily used with tls. May be used without tls only if the client supports a Prior Knowledge mode.
Http1AndHttp2 - requires tls & alpn to negotiate http2, otherwise defaults to http1.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me know if you have a link for "Prior Knowledge mode."

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


## HTTP/2 support

[HTTP/2](https://httpwg.org/specs/rfc7540.html) is available for ASP.NET Core apps running directly on the [Kestrel server](xref:fundamentals/servers/kestrel#http2-support) if the following base requirements are met:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit odd in the Apache doc. Does Apache support forwarding http/2?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps not ... this was one of my points of confusion from your outline. Under "Kestrel: OS," you have ...

Linux W/OpenSSL 1.0.2 (e.g. Ubuntu 16.04)

... which sounds like ur saying that Kestrel can run directly on Linux. I have no personal knowledge beyond what @shirhatti has documented.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linux, yes, but these docs are specifically about Apache and Nginx. They are reverse proxies like ANCM. Unless we have http/2 notes specific to them then there's no need to update these.


## HTTP/2 support

[HTTP/2](https://httpwg.org/specs/rfc7540.html) is available for ASP.NET Core apps running directly on the [Kestrel server](xref:fundamentals/servers/kestrel#http2-support) if the following base requirements are met:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as apache

* Windows Server 2012 R2/Windows 8.1 or later
* Linux with OpenSSL 1.0.2 or later (for example, Ubuntu 16.04 or later)
* HTTP/2 will be supported on macOS in a future release.
* Target framework: ASP.NET Core 2.2 or later
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.NET Core 2.2, not ASP.NET Core 2.2. .NET 4.x doesn't support ALPN or HTTP/2.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it say "Shared framework: ..." since we don't want to confuse TFMs with this remark?

Copy link
Member

@Tratcher Tratcher Sep 16, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TFM is more applicable. In-proc and ALPN both have dependencies on .NET Core 2.2 and don't support .NET 4.x.

* Target framework: Not applicable to HTTP.sys deployments.
* [IIS (in-process)](xref:host-and-deploy/iis/index#http2-support)
* Windows Server 2016/Windows 10 or later; IIS 10 or later
* Target framework: ASP.NET Core 2.2 or later
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.NET Core 2.2, no .NET 4.x support for in-proc.

* Operating system†
* Windows Server 2012 R2/Windows 8.1 or later
* Linux with OpenSSL 1.0.2 or later (for example, Ubuntu 16.04 or later)
* Target framework: ASP.NET Core 2.2 or later
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.NET Core 2.2

| `HttpProtocols` enum value | Connection protocol permitted |
| -------------------------- | ----------------------------- |
| `Http1` | HTTP/1.1 only. Can be used with or without TLS. |
| `Http2` | HTTP/2 only. Primarily used with TLS 1.2 or later. May be used without TLS 1.2 or later only if the client supports a [Prior Knowledge mode](https://tools.ietf.org/html/rfc7540#section-3.4). |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1.2 or later is distracting here. It's not about the version, it's a bout TLS vs clear text.

| -------------------------- | ----------------------------- |
| `Http1` | HTTP/1.1 only. Can be used with or without TLS. |
| `Http2` | HTTP/2 only. Primarily used with TLS 1.2 or later. May be used without TLS 1.2 or later only if the client supports a [Prior Knowledge mode](https://tools.ietf.org/html/rfc7540#section-3.4). |
| `Http1AndHttp2` | HTTP/1.1 and HTTP/2. Requires a TLS 1.2 or later and [Application-Layer Protocol Negotiation (ALPN)](https://tools.ietf.org/html/rfc7301#section-3) connection to negotiate HTTP/2; otherwise, the connection defaults to HTTP/1.1. |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same about the version here.


* In-process
* Windows Server 2016/Windows 10 or later; IIS 10 or later
* Target framework: ASP.NET Core 2.2 or later
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.NET Core 2.2


* Windows Server 2016/Windows 10 or later; IIS 10 or later
* Edge connections use HTTP/2, but the reverse proxy connection to the [Kestrel server](xref:fundamentals/servers/kestrel) uses HTTP/1.1.
* Target framework: Not applicable to out-of-process deployments, since the HTTP/2 connection is handled entirely by IIS.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • TLS 1.2 or later connection


::: moniker-end

If an HTTP/2 connection is established, [HttpRequest.Protocol](xref:Microsoft.AspNetCore.Http.HttpRequest.Protocol*) reports `HTTP/2`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HttpRequest.Protocol is only set to Http/2 for in proc, not out of proc.

@guardrex guardrex requested a review from scottaddie September 17, 2018 00:27
`Http2.MaxStreamsPerConnection` limits the number of concurrent request streams per HTTP/2 connection. Excess streams are refused.

```csharp
.ConfigureKestrel((context, options) =>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indicate where this code belongs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nah ..... changed my mind lol

Let me see if I can deal with all 12 of these instances right now. The sample issue tho still remains, and so does the issue to address Kestrel topic sections/section headers.

The following example permits HTTP/1.1 and HTTP/2 connections on port 8000. Connections are secured by TLS with a supplied certificate:

```csharp
options.Listen(IPAddress.Any, 8000, listenOptions =>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indicate where this code belongs.

@guardrex
Copy link
Collaborator Author

@scottaddie kk --- that might† get every one, including UseKestrel, in context.

†This topic has become a 🐻 to work on.

IIRC there will be overlap between 1.x and 3.0, as I think 1.x probably depreciates after 3.0 RTM.

I pray to the 🙏 server gods 🙏 for file versioning by then.

@guardrex
Copy link
Collaborator Author

ty @scottaddie

@Tratcher U ok with the latest updates?

@Tratcher
Copy link
Member

:shipit:

@guardrex guardrex merged commit 097d3b2 into master Sep 17, 2018
@guardrex guardrex deleted the guardrex/http2 branch September 17, 2018 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants