Re: [TLS] TLS 1.3, how to close the read side of a connection?

Eric Rescorla <ekr@rtfm.com> Wed, 07 March 2018 17:52 UTC

Return-Path: <ekr@rtfm.com>
X-Original-To: tls@ietfa.amsl.com
Delivered-To: tls@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 12860120721 for <tls@ietfa.amsl.com>; Wed, 7 Mar 2018 09:52:16 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.598
X-Spam-Level:
X-Spam-Status: No, score=-2.598 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=rtfm-com.20150623.gappssmtp.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3f9fBpmUMFYy for <tls@ietfa.amsl.com>; Wed, 7 Mar 2018 09:52:14 -0800 (PST)
Received: from mail-qk0-x22d.google.com (mail-qk0-x22d.google.com [IPv6:2607:f8b0:400d:c09::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 2BFFD12420B for <tls@ietf.org>; Wed, 7 Mar 2018 09:52:14 -0800 (PST)
Received: by mail-qk0-x22d.google.com with SMTP id d206so3676515qkb.3 for <tls@ietf.org>; Wed, 07 Mar 2018 09:52:14 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rtfm-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Rv1e8OdhiRI7XH7aZ/F4K2VE3zYDEZBkpIQGOO0sa2w=; b=tYdLtB5UULiKaaDN0sp378GY2jIF5S9RLqTtAxlXxUuk/4/5hxHNSqCGUzoHB87FI/ VXOtSIChBD5faUJ07vywJbazq82Dk4BZl09djilvwHW6eZI1hSWybF+FqGF0wpsBLtMI ue96kYD3gASG1cpV7HfMHdR6ToCIqYeljb2GrQw3slP/WB9eCzxGHWUL7nlLG6ACxcmf 1q7Bu8h0MVAisdc3UR2RoChEa4eCp1i1NvL/qO3JnFNgsCL/cDCOlgM2OOY9KxsBrSe9 B7KkMCkJrG25aXelvBvyVZCAzLnLhZS5V0wUnIuGwNy56ppA0lau7Nm/C+vNpl+WPvMF mrtw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Rv1e8OdhiRI7XH7aZ/F4K2VE3zYDEZBkpIQGOO0sa2w=; b=AZiUpCYxztPVCxdusiJri9SccDRp2mIyOGU7W3Ge21W6Tjf1Vy4MmfEjsOYV8iz1jk fDIc7gyPShhqlF0E9w0EyinoyBViYSUQ3r/wj8Zf9rLsNxz/6fk7eVSoIF9enMbngY3Q qxhwmBdSceJfTUjxx4DcviIK3XMOHhQ3kOyuriXwDM5sg/lnLuKb9jGHYD4rArU9Y0ND CA/sRHg/i7GQSe92Degf5h47BtUN1ELRbii4YK2tcmli8gZo36IKRsQ2oKPl1UAGJlgw aIMuyvIb0xt1bzbaNaZE9TlwhCAnED+4FeiSSMx0ohrkkAy6BIdz6lloC4jwfGtQt/mK R5Nw==
X-Gm-Message-State: AElRT7EHknNMLOMKInXIWDS9lmtCj9R/IyZQRkhrLaPExOJrCxsPZsK9 Vih07uw6+f///5JAxtO599Dr1wnB7Blu1hQuS+Vx3DsQ
X-Google-Smtp-Source: AG47ELvP87JEH48AhIfkDp1IGzAejPQ10bMWV9gkSYgldiL+iWbAgb5g7soRIxDbOlfq9zeF9zyv9pzXn2Rk5rGJEWk=
X-Received: by 10.55.221.198 with SMTP id u67mr35040802qku.91.1520445133177; Wed, 07 Mar 2018 09:52:13 -0800 (PST)
MIME-Version: 1.0
Received: by 10.200.37.176 with HTTP; Wed, 7 Mar 2018 09:51:32 -0800 (PST)
In-Reply-To: <CAJR_8q+LmWLk92dEq6ZQ0+jsanWJLbptB4RwdmkhNncSLZs6wA@mail.gmail.com>
References: <CAJR_8q+LmWLk92dEq6ZQ0+jsanWJLbptB4RwdmkhNncSLZs6wA@mail.gmail.com>
From: Eric Rescorla <ekr@rtfm.com>
Date: Wed, 07 Mar 2018 09:51:32 -0800
Message-ID: <CABcZeBM-XM4XeeKuAjpBizDOxOvqN92-QRp5-T371xkTi6BmgA@mail.gmail.com>
To: Xuelei Fan <xuelei.fan@vimous.com>
Cc: "<tls@ietf.org>" <tls@ietf.org>
Content-Type: multipart/alternative; boundary="001a114992e01060530566d63838"
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/TfhD6_ghKh-c5hsVmqRYobseOMQ>
Subject: Re: [TLS] TLS 1.3, how to close the read side of a connection?
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: "This is the mailing list for the Transport Layer Security working group of the IETF." <tls.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/tls>, <mailto:tls-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/tls/>
List-Post: <mailto:tls@ietf.org>
List-Help: <mailto:tls-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tls>, <mailto:tls-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 07 Mar 2018 17:52:16 -0000

Well, this is like TCP in that respect. You send close_notify and then you
either stop reading off of or close the TCP socket.

-Ekr


On Wed, Mar 7, 2018 at 9:40 AM, Xuelei Fan <xuelei.fan@vimous.com> wrote:

> Hi,
>
> Per TLS 1.3 draft (Section 6.1, Closure Alerts), the close_notify alert is
> used to notify the recipient that the sender will not send any more
> messages on this connection.  And this does not have any effect on its read
> side of the connection.  I think it means that after sending the
> close_notify alert, it still can keep reading data from the peer; and after
> receiving the close_notify alert, it still can keep sending data to the
> peer.
>
> The question comes to me is about how to close the read side of the
> connection.  If closing the read side silently, there are potential issues
> if the application protocol using TLS provides that any data may be carried
> over the underlying transport after the TLS connection is closed.  If
> sending a close_notify alert, the peer may just treat is as close the its
> read side and may keep write in its write side.  It does not actually close
> the read side cleanly.  If keep waiting for the close_notify from the peer,
> the local may have to wait until the peer happy to close its write side.
> It does not sound friendly to the local side.   From example, if I download
> a 10GB video via TLS 1.3 over VPN, looks like there is no way to indicate
> the server that I want to cancle in the middle of the downloading in TLS
> layer.  I may miss something.  I did not find a solution about how to close
> the read side of TLS 1.3 connections yet.  Please help if you have an idea!
>
> It's not a problem in TLS 1.2 and prior versions, as the peer MUST respond
> with a close_notify of its own after receiving a close_notify alert.
>
> Thanks,
> Xuelei Fan
>
> _______________________________________________
> TLS mailing list
> TLS@ietf.org
> https://www.ietf.org/mailman/listinfo/tls
>
>