Re: [hybi] Fwd: failed TLS handshake: which close code?

"Richard L. Barnes" <rbarnes@bbn.com> Mon, 24 October 2011 16:31 UTC

Return-Path: <rbarnes@bbn.com>
X-Original-To: hybi@ietfa.amsl.com
Delivered-To: hybi@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 241A321F8C48 for <hybi@ietfa.amsl.com>; Mon, 24 Oct 2011 09:31:01 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -106.599
X-Spam-Level:
X-Spam-Status: No, score=-106.599 tagged_above=-999 required=5 tests=[AWL=0.000, BAYES_00=-2.599, RCVD_IN_DNSWL_MED=-4, USER_IN_WHITELIST=-100]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BBt+r9KvY8YX for <hybi@ietfa.amsl.com>; Mon, 24 Oct 2011 09:31:00 -0700 (PDT)
Received: from smtp.bbn.com (smtp.bbn.com [128.33.1.81]) by ietfa.amsl.com (Postfix) with ESMTP id 9EB5621F8AC3 for <hybi@ietf.org>; Mon, 24 Oct 2011 09:30:54 -0700 (PDT)
Received: from ros-dhcp192-1-51-60.bbn.com ([192.1.51.60]:59030) by smtp.bbn.com with esmtps (TLSv1:AES128-SHA:128) (Exim 4.74 (FreeBSD)) (envelope-from <rbarnes@bbn.com>) id 1RINQL-0003dp-H3; Mon, 24 Oct 2011 12:30:53 -0400
Mime-Version: 1.0 (Apple Message framework v1084)
Content-Type: text/plain; charset="us-ascii"
From: "Richard L. Barnes" <rbarnes@bbn.com>
In-Reply-To: <634914A010D0B943A035D226786325D42D0B036EF5@EXVMBX020-12.exch020.serverdata.net>
Date: Mon, 24 Oct 2011 12:30:53 -0400
Content-Transfer-Encoding: quoted-printable
Message-Id: <8570DF2D-2EA1-40B4-9B18-608111BE5115@bbn.com>
References: <634914A010D0B943A035D226786325D42D0B036D6D@EXVMBX020-12.exch020.serverdata.net> <CADkeqZXXRkXCRrONLr5thwOqNVUxNWU0Q-9E0R0i=4S-bc-LFw@mail.gmail.com> <CADkeqZXDvu-JY8aZHJJPRH-_JnF196JjA_JG6X_1yrYSiAekuA@mail.gmail.com> <0ED03DDD-1AF9-41F9-B5F0-2968BF16E378@zaphoyd.com> <CADkeqZVvU31ML8tDAeYwnndvPZ9W8vEuzJksBm-4d1qv7MWObw@mail.gmail.com> <634914A010D0B943A035D226786325D42D0B036E9D@EXVMBX020-12.exch020.serverdata.net> <D5E88D14-C13E-490D-933E-6B133BAF98E3@bbn.com> <634914A010D0B943A035D226786325D42D0B036EF5@EXVMBX020-12.exch020.serverdata.net>
To: Tobias Oberstein <tobias.oberstein@tavendo.de>
X-Mailer: Apple Mail (2.1084)
Cc: "hybi@ietf.org" <hybi@ietf.org>, Peter Thorson <webmaster@zaphoyd.com>
Subject: Re: [hybi] Fwd: failed TLS handshake: which close code?
X-BeenThere: hybi@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Server-Initiated HTTP <hybi.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/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: Mon, 24 Oct 2011 16:31:01 -0000

Quoting the same part of the WS API spec as I did earlier:
"
If the user agent was required to fail the websocket connection or the WebSocket connection is closed with prejudice, fire a simple event named error at the WebSocket object.
"

A TLS failure requires the UA to fail the websocket connection, and should result in an error event, not a close event.  So it seems that Chrome and Firefox are not following the spec in this regard.

--Richard





On Oct 24, 2011, at 12:25 PM, Tobias Oberstein wrote:

>> This is pointless.  These codes are not needed by the WS API, since a TLS
>> failure does not provide a close code. 
> 
> Well, both Chrome (16.0.912.10 canary) and Firefox (10.0a1 (2011-10-24))
> _do_ fire the onclose() event handler with 1006 when the WS connection cannot
> even be established (host unreachable).
> 
> Firefox fires the onclose() with 1006 also for WSS when the server cert is invalid.
> Chrome currently does not check WSS server cert (unrelated beh./bug).
> 
> So both browsers are wrong?
> 
> Anyway: what is your recommendation for WS API for _apps_ (JavaScript) to recognize "invalid server cert"?
>