Re: [hybi] WebSocket, TLS and intermediaries

Greg Wilkins <gregw@webtide.com> Wed, 21 July 2010 23:55 UTC

Return-Path: <gregw@webtide.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 45FA73A6840 for <hybi@core3.amsl.com>; Wed, 21 Jul 2010 16:55:35 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.79
X-Spam-Level:
X-Spam-Status: No, score=-1.79 tagged_above=-999 required=5 tests=[AWL=0.186, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001]
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 nDatSYRGzWrD for <hybi@core3.amsl.com>; Wed, 21 Jul 2010 16:55:34 -0700 (PDT)
Received: from mail-fx0-f44.google.com (mail-fx0-f44.google.com [209.85.161.44]) by core3.amsl.com (Postfix) with ESMTP id 0FFAF3A6892 for <hybi@ietf.org>; Wed, 21 Jul 2010 16:55:33 -0700 (PDT)
Received: by fxm1 with SMTP id 1so4358941fxm.31 for <hybi@ietf.org>; Wed, 21 Jul 2010 16:55:50 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.223.121.19 with SMTP id f19mr1057832far.73.1279756550297; Wed, 21 Jul 2010 16:55:50 -0700 (PDT)
Received: by 10.223.112.129 with HTTP; Wed, 21 Jul 2010 16:55:50 -0700 (PDT)
In-Reply-To: <AANLkTinB_6BSY5wil2JRCweETIrG0iwH67i6-4_xR2d9@mail.gmail.com>
References: <h2w5c902b9e1004152345j992b815bz5f8d38f06a19181a@mail.gmail.com> <Pine.LNX.4.64.1004160701250.751@ps20323.dreamhostps.com> <4BC860FD.8080007@webtide.com> <Pine.LNX.4.64.1004161952530.751@ps20323.dreamhostps.com> <35EFEA5E-9017-48A1-BB66-A0AF947E159F@d2dx.com> <AANLkTinihlL2sn3Kiwtcl7QYKhFlvmj9lvmH4_z02xF7@mail.gmail.com> <FC1F510E-6D48-4D75-A356-F455C9FD5BD8@apple.com> <4C468EAE.4050507@gmx.de> <02BB0E0C-133B-4733-B053-A9D6E870F199@apple.com> <Pine.LNX.4.64.1007212245020.7242@ps20323.dreamhostps.com> <AANLkTinB_6BSY5wil2JRCweETIrG0iwH67i6-4_xR2d9@mail.gmail.com>
Date: Thu, 22 Jul 2010 09:55:50 +1000
Message-ID: <AANLkTiko9e2_xKLpgPlUSVBvRVY37aPmUrAagmeQsY1Q@mail.gmail.com>
From: Greg Wilkins <gregw@webtide.com>
To: Mike Belshe <mike@belshe.com>
Content-Type: multipart/alternative; boundary="001636c596eb9457c5048bee8ae5"
Cc: Hybi <hybi@ietf.org>
Subject: Re: [hybi] WebSocket, TLS and intermediaries
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: Wed, 21 Jul 2010 23:55:35 -0000

On 22 July 2010 09:42, Mike Belshe <mike@belshe.com> wrote:

> On the TLS issue, we're going in circles.  Both sides are correct on the
> facts about the pros and cons of TLS (more or less).  I don't think the spec
> should require TLS.  But, would it be possible to define alternate
> handshakes based on whether TLS is used?
>
> If we use the currently defined handshake, TLS will be at a performance
> disadvantage to insecure WebSockets, because TLS will require more
> round-trips.
>
> Could we define, as part of the WebSocket protocol, that when WebSocket is
> negotiated over TLS it uses the TLS/NPN extension to effectively fold the
> WebSocket Upgrade handshake into the TLS handshake?  This removes a round
> trip from the WebSocket startup time.  The next-protocol-negotiation
> extension is defined here:
> http://tools.ietf.org/html/draft-agl-tls-nextprotoneg-00
>

+1

there has been on opinion expressed that we can only ever have 1 websocket
handshake.  Thus because we are starting with port 80, the handshake is
currently some mutant child of HTTP that must be sent even if another port
is used and no HTTP is involved.

This approach is  stuck trying to fixate on the exact syntax of the
handshake, literally down to counting spaces!

Instead we need to establish the semantic context in which a websocket
connection can be established, and then allow multiple ways to establish
that context.   HTTP upgrade is one such way, TLS/NPN is another.  I'm sure
there will eventually be more (maybe SPDY will support a DOWNGRADE method :)

If the semantic context is secure (eg contains random token generated after
any URL was formed by application), then does it really matter what syntax
was used to establish the context?

regards