[hybi] Comments about draft-13

Iñaki Baz Castillo <ibc@aliax.net> Fri, 02 September 2011 11:59 UTC

Return-Path: <ibc@aliax.net>
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 61A3621F8E9C for <hybi@ietfa.amsl.com>; Fri, 2 Sep 2011 04:59:40 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.644
X-Spam-Level:
X-Spam-Status: No, score=-2.644 tagged_above=-999 required=5 tests=[AWL=0.033, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, MIME_8BIT_HEADER=0.3, RCVD_IN_DNSWL_LOW=-1]
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 dDJ3057psifq for <hybi@ietfa.amsl.com>; Fri, 2 Sep 2011 04:59:39 -0700 (PDT)
Received: from mail-qw0-f52.google.com (mail-qw0-f52.google.com [209.85.216.52]) by ietfa.amsl.com (Postfix) with ESMTP id 8144821F8E9B for <hybi@ietf.org>; Fri, 2 Sep 2011 04:59:39 -0700 (PDT)
Received: by qwb8 with SMTP id 8so2352801qwb.25 for <hybi@ietf.org>; Fri, 02 Sep 2011 05:01:15 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.229.3.81 with SMTP id 17mr729977qcm.101.1314964874875; Fri, 02 Sep 2011 05:01:14 -0700 (PDT)
Received: by 10.229.79.207 with HTTP; Fri, 2 Sep 2011 05:01:14 -0700 (PDT)
Date: Fri, 02 Sep 2011 14:01:14 +0200
Message-ID: <CALiegfkUMDfuRC+16ZcLo__2OqAcQ1UVDGa_610ykEAe6yZViw@mail.gmail.com>
From: Iñaki Baz Castillo <ibc@aliax.net>
To: hybi@ietf.org
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Subject: [hybi] Comments about draft-13
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: Fri, 02 Sep 2011 11:59:40 -0000

Some doubts about draft 13:


1)

-------------------------------
  1.6.  Security Model

          6.  If the response includes a "Sec-WebSocket-Protocol" header field,	
 	       and this header field indicates the use of a subprotocol that was	
 	       not present in the client' handshake (the server has indicated a	
 	       subprotocol not requested by the client), the client MUST _Fail	
 	       the WebSocket Connection_.  (The parsing of this header field to	
 	       determine which extensions are requested is discussed in	
 	       Section 9.1.)
---------------------------------

Why is this text speaking about "extensions"? do I miss something?



2) Sec-WebSocket-Extensions BNF grammar still relies on RFC 2616
"implied *LWS". Please, don't reference it. Pure ABNF does not allow
it, it's just a hack in RFC 2616. Instead, change the current text:

---------------------------
9.1.  Negotiating Extensions

   A client requests extensions by including a "Sec-WebSocket-
   Extensions" header field, which follows the normal rules for HTTP
   header fields (see [RFC2616] section 4.2) and the value of the header
   field is defined by the following ABNF.  Note that unlike other
   section of the document this section is using ABNF syntax/rules from
   [RFC2616], including "implied *LWS rule".  If a value is received by
   either the client or the server during negotiation that does not
   conform to the ABNF below, the recipient of such malformed data MUST
   immediately _Fail the WebSocket Connection_.

         Sec-WebSocket-Extensions = extension-list
         extension-list = 1#extension
         extension = extension-token *( ";" extension-param )
         extension-token = registered-token
         registered-token = token
         extension-param = token [ "=" token ]
---------------------------


with this:

---------------------------
9.1.  Negotiating Extensions

   A client requests extensions by including a "Sec-WebSocket-
   Extensions" header field, which follows the normal rules for HTTP
   header fields (see [RFC2616] section 4.2) and the value of the header
   field is defined by the following ABNF.  If a value is received by
   either the client or the server during negotiation that does not
   conform to the ABNF below, the recipient of such malformed data MUST
   immediately _Fail the WebSocket Connection_.

         Sec-WebSocket-Extensions = extension-list
         extension-list = 1#extension
         extension = extension-token *( SEMI extension-param )
         extension-token = registered-token
         registered-token = token
         extension-param = token [ "=" token ]
         SEMI  = SWS ";" SWS;
         SWS  = LWS?;
---------------------------

Of course, the same should be changed in "4.3 Collected ABNF for new
header fields used in handshake" as it repeats the
Sec-WebSocket-Extensions ABNF !!



3) Section 4.2.2 does include nothing about a 4XX HTTP response code
for the case in which the WS clients offers N WS subprotocols and the
server supports no one of them. Current text states that the server
MUST reply 101 without Sec-WebSocket-Protocol, so the client would
then MUST Fail_The_Connection.

There has been a long thread recently suggesting that in that case
(and just in *that* case) the server whould *reject* the GET request
with a *specific* HTTP status code which would mean "I don't support
any of your suggested WS protocols, so I cannot accept the WS session
because I have no idea what we are supposed to speak".

This is a new protocol, so feel *free* to create a new "HTTP" response
code for this case, maybe:

  488 WebSocket SubProtocol Not Supported

As I explained in other thread, this status code could help the human
user and the client application developer to realize that his software
is not up-to-date with the service requeriments ("your programm is too
old, upgrade please").




Regards.




-- 
Iñaki Baz Castillo
<ibc@aliax.net>