Re: [Doh] How to start HTTP/2?

Daniel Stenberg <daniel@haxx.se> Tue, 16 January 2018 15:13 UTC

Return-Path: <daniel@haxx.se>
X-Original-To: doh@ietfa.amsl.com
Delivered-To: doh@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id AEC2F12DA25 for <doh@ietfa.amsl.com>; Tue, 16 Jan 2018 07:13:19 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.211
X-Spam-Level:
X-Spam-Status: No, score=-4.211 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=ham autolearn_force=no
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 fqXk0tUsDimh for <doh@ietfa.amsl.com>; Tue, 16 Jan 2018 07:13:18 -0800 (PST)
Received: from giant.haxx.se (www.haxx.se [IPv6:2a00:1a28:1200:9::2]) by ietfa.amsl.com (Postfix) with ESMTP id B2EE113151A for <doh@ietf.org>; Tue, 16 Jan 2018 07:12:42 -0800 (PST)
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50]) by giant.haxx.se (8.15.2/8.15.2/Debian-4) with ESMTPS id w0GFCdMY006473 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 Jan 2018 16:12:39 +0100
Received: from localhost (dast@localhost) by giant.haxx.se (8.15.2/8.15.2/Submit) with ESMTP id w0GFCdXS006468; Tue, 16 Jan 2018 16:12:39 +0100
X-Authentication-Warning: giant.haxx.se: dast owned process doing -bs
Date: Tue, 16 Jan 2018 16:12:39 +0100 (CET)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: Stephane Bortzmeyer <bortzmeyer@nic.fr>
cc: doh@ietf.org
In-Reply-To: <20180116150246.dvr3d3nstozqfadn@nic.fr>
Message-ID: <alpine.DEB.2.20.1801161607110.20551@tvnag.unkk.fr>
References: <20180116150246.dvr3d3nstozqfadn@nic.fr>
User-Agent: Alpine 2.20 (DEB 67 2015-01-07)
X-fromdanielhimself: yes
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII; format=flowed
Archived-At: <https://mailarchive.ietf.org/arch/msg/doh/6kqTL5RA8cYTnCpauBWUUDj2_g8>
Subject: Re: [Doh] How to start HTTP/2?
X-BeenThere: doh@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: DNS Over HTTPS <doh.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/doh>, <mailto:doh-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/doh/>
List-Post: <mailto:doh@ietf.org>
List-Help: <mailto:doh-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/doh>, <mailto:doh-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 16 Jan 2018 15:13:20 -0000

On Tue, 16 Jan 2018, Stephane Bortzmeyer wrote:

> RFC 7540 specifies several ways to start HTTP/2 over a TCP connection 
> (section 3), such as upgrade from HTTP/1, or starting directly HTTP/2 if you 
> know the server accepts it. Which one should be used by DoH clients and 
> servers? Section 7 of draft-ietf-doh-dns-over-https-02 seems silent about 
> it.

If you stick to HTTPS (which the spec says we must in section 4) then there's 
only one way: negotiate HTTP version with ALPN. It also happens to be the 
easiest way for clients IMHO.

> Note that some clients are currently limited. I don't think you can 
> immediately send HTTP/2 frames with curl, for instance.

curl can actually do the three common ways:

1. negotiate HTTP/2 with HTTPS

2. upgrade from h1 using clear-text HTTP (but upgrade to HTTP/2 on a POST is 
not very supported by servers)

3. do "prior knowledge" HTTP/2 over clear-text HTTP

-- 

  / daniel.haxx.se