Re: Is the response header "Upgrade: h2" allowed when TLS is used?

Stefan Eissing <stefan.eissing@greenbytes.de> Tue, 19 April 2016 16:10 UTC

Return-Path: <ietf-http-wg-request+bounce-httpbisa-archive-bis2juki=lists.ie@listhub.w3.org>
X-Original-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Delivered-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 0288C12E083 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 19 Apr 2016 09:10:52 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -8.017
X-Spam-Level:
X-Spam-Status: No, score=-8.017 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.996, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=greenbytes.de header.b=rxenTPKg; dkim=pass (1024-bit key) header.d=greenbytes.de header.b=XxJXwA63
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5BMNEwcKtxS8 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 19 Apr 2016 09:10:48 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 646A112E06A for <httpbisa-archive-bis2Juki@lists.ietf.org>; Tue, 19 Apr 2016 09:10:48 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.80) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1asYAL-0006gT-CZ for ietf-http-wg-dist@listhub.w3.org; Tue, 19 Apr 2016 16:06:17 +0000
Resent-Date: Tue, 19 Apr 2016 16:06:17 +0000
Resent-Message-Id: <E1asYAL-0006gT-CZ@frink.w3.org>
Received: from maggie.w3.org ([128.30.52.39]) by frink.w3.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from <stefan.eissing@greenbytes.de>) id 1asYAJ-0006er-EP for ietf-http-wg@listhub.w3.org; Tue, 19 Apr 2016 16:06:15 +0000
Received: from mail.greenbytes.de ([5.10.171.186]) by maggie.w3.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from <stefan.eissing@greenbytes.de>) id 1asYAG-0004ZF-Hh for ietf-http-wg@w3.org; Tue, 19 Apr 2016 16:06:14 +0000
Received: by mail.greenbytes.de (Postfix, from userid 117) id 24D9615A0874; Tue, 19 Apr 2016 18:05:44 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=greenbytes.de; s=mail; t=1461081944; bh=S+RM7jal5xElqUpTFkJP4R213g8l8GNADUPZRmOGJlM=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=rxenTPKg3ejlM0bk6UMHqcczTGCA7HEZrI2U3lY2iwjt9+mG2/BJdAOEF++9sd3Tk YNrKrI8TUGhZn390vVuZ7lI9hiAWjp4fRlcBAZM9YhfxiZQ1Gi3tz+PVjsieGkXti0 +tlInwgHmmtZGWqTrT6/zENCXK94lf+ij3K3QBbU=
Received: from [192.168.1.42] (unknown [192.168.1.1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mail.greenbytes.de (Postfix) with ESMTPSA id A0C2D15A01A9; Tue, 19 Apr 2016 18:05:42 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=greenbytes.de; s=mail; t=1461081942; bh=S+RM7jal5xElqUpTFkJP4R213g8l8GNADUPZRmOGJlM=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=XxJXwA63117eqd05Xfm0c+jKzFlds+wrqSVjK+0sg/+4LVgOeQb5G4xK1zaVwWzId 0VaphjgW4gxnKJQ7wJdY2OlYJF8c3Krw4/koZvS2z/+PlHvjIG8aKsCa2uOHme2mhT q0FG0A9lsv26gixiqVTOdqovTgyNoACIWbOQR7dA=
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
From: Stefan Eissing <stefan.eissing@greenbytes.de>
In-Reply-To: <BE75D624-3A89-463A-B860-A2E83613C199@lukasa.co.uk>
Date: Tue, 19 Apr 2016 18:05:42 +0200
Cc: Lucas Pardue <Lucas.Pardue@bbc.co.uk>, "ietf-http-wg@w3.org" <ietf-http-wg@w3.org>
Content-Transfer-Encoding: quoted-printable
Message-Id: <5CBBE2E0-BA35-42B6-9E19-D658753D593B@greenbytes.de>
References: <20160419161634.Horde.7_VYZk5McZE4CAiQrQh-uXr@webmail.michael-kaufmann.ch> <7CF7F94CB496BF4FAB1676F375F9666A2A7CBD72@bgb01xud1012> <BE75D624-3A89-463A-B860-A2E83613C199@lukasa.co.uk>
To: Cory Benfield <cory@lukasa.co.uk>
X-Mailer: Apple Mail (2.3124)
Received-SPF: pass client-ip=5.10.171.186; envelope-from=stefan.eissing@greenbytes.de; helo=mail.greenbytes.de
X-W3C-Hub-Spam-Status: No, score=-6.0
X-W3C-Hub-Spam-Report: AWL=-0.987, BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RP_MATCHES_RCVD=-0.996, SPF_PASS=-0.001, W3C_AA=-1, W3C_WL=-1
X-W3C-Scan-Sig: maggie.w3.org 1asYAG-0004ZF-Hh 11d7fa86d9b873ab0ae55d41fcecefed
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Is the response header "Upgrade: h2" allowed when TLS is used?
Archived-At: <http://www.w3.org/mid/5CBBE2E0-BA35-42B6-9E19-D658753D593B@greenbytes.de>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/31509
X-Loop: ietf-http-wg@w3.org
Resent-Sender: ietf-http-wg-request@w3.org
Precedence: list
List-Id: <ietf-http-wg.w3.org>
List-Help: <http://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

> Am 19.04.2016 um 17:29 schrieb Cory Benfield <cory@lukasa.co.uk>:
> 
> 
>> On 19 Apr 2016, at 16:16, Lucas Pardue <Lucas.Pardue@bbc.co.uk> wrote:
>> 
>> Stefan and Daniel point out that the server uses the Upgrade header to "advertise support" for h2. RFC 7230 Section 6.7 [5] states that the server MAY send the Upgrade header. It seems to me like Apache is technically compliant. On an https connection this information shouldn't be used to perform an HTTP upgrade to h2, since that is invalid (but a client issue not a server one). On an http connection the info could be used by the client e.g. they decide to negotiate an h2 session using ALPN.
> 
> I don’t think that’s really a good way to read this section of RFC 7230. The first sentence in this section is 'The "Upgrade" header field is intended to provide a simple mechanism for transitioning from HTTP/1.1 to some other protocol on the same connection.’. Note that phrase “on the same connection”. I’d argue, based on that, that the server-sent Upgrade header should only list protocols that the server is willing to upgrade to *on that connection*.

The mechanism is there and could be use. I do not know of a client which can though...

And rfc 7540, ch. 3.2 says: "A server MUST ignore an "h2" token in an Upgrade header field. Presence of a token with "h2" implies HTTP/2 over TLS, which is instead negotiated as described in Section 3.3."

Reading that, a server can never support this. So, we are in violation...rebels almost...

> If Apache is willing to do the HTTP/2 upgrade dance from a TLS’d HTTP1.1 connection, I’d say that this argument makes sense. Otherwise, I don’t think it does: the client needs to use a new connection, which means the Upgrade header isn’t appropriate. This use-case is satisfied by RFC 7838’s HTTP Alternative Services: Apache should use that header instead, rather than this Upgrade header.
> 
> For what it’s worth, as far as I can see RFC 7540 doesn’t *forbid* doing the Upgrade dance on a TLS’d HTTP/1.1 connection: it just says nothing about it. There’s no normative language in RFC 7540 that says that we MUST use ALPN for “https” URLs, it only says that clients *do* that. I’d say that you can read that as saying that a client MUST implement *at least* support for that, but may also implement support for alternative negotiation means (e.g. HTTP Upgrade).
> 
> Cory