Re: [TLS] Sending fatal alerts over TCP

Marsh Ray <> Tue, 20 December 2011 18:12 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id C0F7721F85EF for <>; Tue, 20 Dec 2011 10:12:38 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -2.599
X-Spam-Status: No, score=-2.599 tagged_above=-999 required=5 tests=[BAYES_00=-2.599]
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id j5hjcOgY+4zg for <>; Tue, 20 Dec 2011 10:12:38 -0800 (PST)
Received: from ( []) by (Postfix) with ESMTP id 4473A21F85A7 for <>; Tue, 20 Dec 2011 10:12:38 -0800 (PST)
Received: from ([]) by with esmtpa (Exim 4.72) (envelope-from <>) id 1Rd4B3-000INY-Qv; Tue, 20 Dec 2011 18:12:37 +0000
Received: from [] (localhost []) by (Postfix) with ESMTP id D4DC76067; Tue, 20 Dec 2011 18:12:35 +0000 (UTC)
X-Mail-Handler: MailHop Outbound by DynDNS
X-Report-Abuse-To: (see for abuse reporting information)
X-MHO-User: U2FsdGVkX19+BhcOsy0iIAzwodCDFC3h0e53P7jF34Y=
Message-ID: <>
Date: Tue, 20 Dec 2011 12:12:36 -0600
From: Marsh Ray <>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20110921 Thunderbird/3.1.15
MIME-Version: 1.0
To: Florian Weimer <>
References: <>
In-Reply-To: <>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Subject: Re: [TLS] Sending fatal alerts over TCP
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: "This is the mailing list for the Transport Layer Security working group of the IETF." <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Tue, 20 Dec 2011 18:12:38 -0000

On 12/20/2011 07:15 AM, Florian Weimer wrote:
> TCP has the property that connection shutdowns can overtake application
> data if connections are used in full-duplex mode.
> Here's an example:
>    X sends a fatal TLS alert to Y
>    X shuts down the connection
>    Y sends data to X
>    X receives from Y, sends RST to signal data loss to Y

This would seem to be against the spirit of (section 3.5. Closing a Connection) 
which says "Users must keep reading connections they close for sending 
until the TCP says no more data."

>    Y receives RST
> At this point, when Y tries to send further data, it will receive EPIPE
> from the sockets API.  When it tries to read data, it will receive
> ECONNRESET.  According to the socket API sepcification, there is no way
> to access the initial TLS alert.

My interpretation is that RSTs are generally to be avoided by 
properly-coded applications and a fatal TLS alert should not prevent the 
graceful close of the TCP socket.

I have heard of client apps that crash badly upon receiving an RST. 
(Alternatively this could be used to argue that they should be sent much 
more frequently, but that's another discussion :-)

- Marsh