Re: [hybi] Client offers invalid WS protocols, what must the server do? 101???

Philipp Serafin <phil127@gmail.com> Wed, 31 August 2011 16:17 UTC

Return-Path: <phil127@gmail.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 D0FCE21F8B5E for <hybi@ietfa.amsl.com>; Wed, 31 Aug 2011 09:17:16 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.539
X-Spam-Level:
X-Spam-Status: No, score=-3.539 tagged_above=-999 required=5 tests=[AWL=0.060, BAYES_00=-2.599, 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 qFWYw1JKMUmG for <hybi@ietfa.amsl.com>; Wed, 31 Aug 2011 09:17:16 -0700 (PDT)
Received: from mail-bw0-f44.google.com (mail-bw0-f44.google.com [209.85.214.44]) by ietfa.amsl.com (Postfix) with ESMTP id CDBB721F8BF4 for <hybi@ietf.org>; Wed, 31 Aug 2011 09:17:15 -0700 (PDT)
Received: by bkar4 with SMTP id r4so1210121bka.31 for <hybi@ietf.org>; Wed, 31 Aug 2011 09:18:42 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; bh=pxtTKgTbhSBt676xBSm3xsojcmFDtyQfyZFGc2mXQtI=; b=AtPWnJkSfa3dSgFv28rka+jkiJH5nHv7QUA8SghL6H0N4Md+kVv3LqFg4+nZvBwRXC RCZ9HUMG9UqMac+24B+Hz9qP0pc7gdeRXR0FNfP1utRVZPotn5cBc6i0q5by0qpY6g6X 0PSY98Mmkn8mn1lmjMUJqlWx2o+Mj2tzPgp5Y=
Received: by 10.204.135.18 with SMTP id l18mr380624bkt.341.1314807518073; Wed, 31 Aug 2011 09:18:38 -0700 (PDT)
Received: from [212.201.70.0] ([212.201.70.0]) by mx.google.com with ESMTPS id h26sm432143bkt.52.2011.08.31.09.18.36 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 31 Aug 2011 09:18:36 -0700 (PDT)
Message-ID: <4E5E5EDA.6000606@gmail.com>
Date: Wed, 31 Aug 2011 18:18:34 +0200
From: Philipp Serafin <phil127@gmail.com>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0.1) Gecko/20110830 Thunderbird/6.0.1
MIME-Version: 1.0
To: hybi@ietf.org
References: <CALiegfkC9dLOnLfSQApE9OjoSV1RXT7cTumZ6+yCR1tWo_cvmw@mail.gmail.com> <4E5CBEA0.2080605@isode.com> <CALiegfn3dPyZMR3ZZ3CtwOeAmC4sxd0=kos4Z82B2qeh_aZASQ@mail.gmail.com> <4E5CC6A7.7030304@isode.com> <CALiegfnc-YRPZZvgJjmvtafKnkJB7rXJ9KcPDKL-ceeAdwGEGQ@mail.gmail.com> <4E5CC8B8.7090702@isode.com> <CALiegfmSs-FhS5AuJHWFhGdbxS4pLSHA1Kk2y_P5GwwG_YneyQ@mail.gmail.com> <CABLsOLCBSnW+R9vr=RbRosTo55tv-_gG9yLdoj5AqW4rU6rcPQ@mail.gmail.com> <4E5D04F8.30801@isode.com>
In-Reply-To: <4E5D04F8.30801@isode.com>
X-Enigmail-Version: 1.3.1
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
Subject: Re: [hybi] Client offers invalid WS protocols, what must the server do? 101???
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: Wed, 31 Aug 2011 16:17:16 -0000

I agree with Inaki that an error code for unsupported subprotocols would
be useful. But I think it would be cleaner if the server would send it
right as part of the handshake instead of the client.

So far it looks to me as if WS connections that make use of sub
protocols serve completely different use cases than those that don't.

On the one hand, we have proprietary, "internal" endpoints that will
solely be implementation details of a web application. The actual
protocol used on top of WS will be tailor-made to that specific
web-application and may change any time without notice. In fact, the
application might even switch to a completely different technology than
WS any time. Both WS client and server will be controlled by the same
developers.
As defining a formal subprotocol in such a case doesn't make much sense,
the protocol header will likely not be used.

On the other hand, we may have standardized, "external", WS-based APIs,
the same way e.g. SOAP and OAUTH can be layered on top of HTTP today.
Here, clients and servers from different parties will have to speak with
each other, some of which might not even run in a browser or might
otherwise be hard to update. Here, standardized subprotocols and the
negotiation mechanism will be of much use.

However, I don't see much overlap in those two use-cases right now. I
don't see many cases where a server that doesn't support a certain
standardized protocols could reasonably fall back to a proprietary
default protocol. This also makes the subprotocol header less useful
IMO, since it implies that the client doesn't actually lists all
protocols it supports in the header - it might or might not also support
an unnamed, proprietary protocol.

Why can't we take the presence of a subprotocol header in the client
request as a hint that the client wants to speak a "standard" protocol?
Then it would be reasoneable for the server to reject the connection if
none of those standard protocols are supported.
However, if the client sends no protocol header, then the server can
still accept the connection and speak an unnamed, proprietary protocol.


Am 30.08.2011 17:42, schrieb Alexey Melnikov:
> John Tamplin wrote:
>
>> On Tue, Aug 30, 2011 at 7:29 AM, Iñaki Baz Castillo <ibc@aliax.net
>> <mailto:ibc@aliax.net>> wrote:
>>
>>     2011/8/30 Alexey Melnikov <alexey.melnikov@isode.com
>>     <mailto:alexey.melnikov@isode.com>>:
>>     > If the client really expected the extensions to be mandatory, it
>>     has to send
>>     > Close.
>>
>>     A new close status code just to say "the WS protocol negotiation has
>>     obviously failed so I close the connection"?
>>
>>
>> We don't need a separate close code for every possible reason --
>> there will be too many, and we will certainly miss many ones that
>> would actually be used.  Instead, we need more generic error codes
>> describing categories of failures.
>
> I think we need both. More specific error codes are better, if
> introduced early.
>
> _______________________________________________
> hybi mailing list
> hybi@ietf.org
> https://www.ietf.org/mailman/listinfo/hybi