Re: [hybi] Proposal: HTTP upgrade process

Vladimir Katardjiev <vladimir@d2dx.com> Tue, 17 August 2010 08:11 UTC

Return-Path: <vladimir@d2dx.com>
X-Original-To: hybi@core3.amsl.com
Delivered-To: hybi@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 1838B3A6819 for <hybi@core3.amsl.com>; Tue, 17 Aug 2010 01:11:52 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.599
X-Spam-Level:
X-Spam-Status: No, score=-2.599 tagged_above=-999 required=5 tests=[BAYES_00=-2.599]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3WaMjjPs3Z+P for <hybi@core3.amsl.com>; Tue, 17 Aug 2010 01:11:50 -0700 (PDT)
Received: from homiemail-a62.g.dreamhost.com (mx1.spunky.mail.dreamhost.com [208.97.132.47]) by core3.amsl.com (Postfix) with ESMTP id B8D783A6822 for <hybi@ietf.org>; Tue, 17 Aug 2010 01:11:50 -0700 (PDT)
Received: from homiemail-a62.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a62.g.dreamhost.com (Postfix) with ESMTP id 93224634073; Tue, 17 Aug 2010 01:12:26 -0700 (PDT)
DomainKey-Signature: a=rsa-sha1; c=nofws; d=d2dx.com; h=subject:mime-version :content-type:from:in-reply-to:date:cc:message-id:references:to; q=dns; s=d2dx.com; b=D3f2/dgtGtrremny+xqpYpzH08pSnOprHwB2/5+gfy luEcnDZR2ESKT5NOOfNzw5ylQd5aQ56em+DOiesdi4Hfp4hZwkx+dj3PLVnasil5 kMHAB2ha/XA3yRqilakVoQWMhm1T0PNZ2ICiWvGxDgNARO+n8LFMheLq/Ig7MQJt A=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=d2dx.com; h=subject :mime-version:content-type:from:in-reply-to:date:cc:message-id :references:to; s=d2dx.com; bh=8Ce+IKFG88qCEgIlLl8WY5YIBtw=; b=i FPmY75ii0a7qMokowmu9Yw3Xc2tppdLN7If1dzeILLKFLK5nNX+D6uifkFd57IFz mHHk/oLNl7FHsT3CqbF8pO5QPEcT4Qx+HusSWmdMfmGNeNmPTjnaHJaEVxIZj0dS xApUWG7UGTrblYtO/u5Ea6zH4yHwJ+ZBLeU4EXTcKs=
Received: from dhcp118.verkstad.net (dhcp118.verkstad.net [192.36.157.118]) (Authenticated sender: vladimir@d2dx.com) by homiemail-a62.g.dreamhost.com (Postfix) with ESMTPA id 91EFC634064; Tue, 17 Aug 2010 01:12:25 -0700 (PDT)
Mime-Version: 1.0 (Apple Message framework v1078)
Content-Type: multipart/signed; boundary="Apple-Mail-27-930349678"; protocol="application/pkcs7-signature"; micalg="sha1"
From: Vladimir Katardjiev <vladimir@d2dx.com>
In-Reply-To: <AANLkTi=aR8+LgcoXDVhuu-HC2k3TB6YP2WcXEo8yC1Jz@mail.gmail.com>
Date: Tue, 17 Aug 2010 10:12:23 +0200
Message-Id: <903054FE-EEFB-46A6-A008-9EBE71EB873A@d2dx.com>
References: <AANLkTi=aR8+LgcoXDVhuu-HC2k3TB6YP2WcXEo8yC1Jz@mail.gmail.com>
To: Greg Wilkins <gregw@webtide.com>
X-Mailer: Apple Mail (2.1078)
Cc: hybi@ietf.org
Subject: Re: [hybi] Proposal: HTTP upgrade process
X-BeenThere: hybi@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Server-Initiated HTTP <hybi.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/hybi>, <mailto:hybi-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/hybi>
List-Post: <mailto:hybi@ietf.org>
List-Help: <mailto:hybi-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/hybi>, <mailto:hybi-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 17 Aug 2010 08:11:52 -0000

On 16 aug 2010, at 03.23, Greg Wilkins wrote:

> All,
> 
> there has been a lot of posting about the -76/-00 style handshake,
> it's HTTP compliance issues, it's fast fail (or otherwise)
> characteristics, it security features etc.    I don't think any of the
> conversations have been very productive nor is there any apparent
> convergence on a solution.
> 
> [snip for length]
> Instead of contributors having to make the case of why the random
> 8-bytes etc. should be excluded from the protocol, those that support
> random bytes should clearly make the case for their inclusion.   We
> need to identify the issues with a simple upgrade request, and then
> discuss various solutions as to how to address these - it may be that
> the random 8 bytes solution is the best solution, but if so, then
> there can be no harm in conducting a process that verifies this is the
> case.

That's (relatively) easy. From Ian's omnibus WebSocket Feedback mail on April 15:

>> If the handshake messages are to contain content, then they MUST have 
>> headers to indicate the content length to be legal HTTP: in this case, a 
>> Content-Length header would be appropriate
> 
> The idea here is that the 8 random bytes are part of the post-Upgrade Web 
> Socket connection, not the GET request, so that any intermediaries will 
> fail to send the data along if they do any interpretation, thus failing 
> early. If we included them in the Content-Length then unfortunately the 
> early failure mode of intermediaries would be lost.

If memory serves, it was also used for checking if the server programmer is also capable of following instructions and generating hashes, a notion that might not be required if the working assumption is no longer that every script implements its own WebSocket stack. This would leave the main reason for those eight bytes a sort of "fail-early" test, so that a WebSocket connection will terminate before the "open" event has been fired in the browser. This is considered preferable to firing the "open" event after a successful handshake, but then losing the connection because, oops, after all it was an incompatible intermediary.

The reason it was baked into the same request package was to avoid having an additional RTT. That is, after the 101 response was received, send a WebSocket-specific frame to the server and await a reply to receive a guarantee that the connection has been successfully established and can transfer WebSocket frames.

> 
> Note that I'm not saying that we should immediately publish a -01
> draft with the handshake reverted, as I think it would be sufficient
> for us just to restart our discussions from that simpler base (but I
> would not object to a reset -01 draft either).

If it is just for these eight bytes I don't see why. As Maciej pointed out, -75 had its own share of problems, so I don't see why we should trade one for the other.

Cheers,
Vladimir