From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id C9F401FF0DF for ; Thu, 05 Nov 2026 18:52:08 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id BF4F521471; Thu, 05 Nov 2026 18:52:06 +0100 (CET) From: Thomas Lamprecht To: pve-devel@lists.proxmox.com, =?UTF-8?q?Michael=20K=C3=B6ppl?= Subject: applied: [PATCH http-server 1/1] apiserver: send TLS close notify at the end of streamed responses Date: Thu, 5 Nov 2026 18:50:42 +0100 Message-ID: <179389936161.3822907.14665617337133974164.b4-ty@b4> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261103155223.1960754-1-m.koeppl@proxmox.com> References: <20261103155223.1960754-1-m.koeppl@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1793901123172 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.342 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: YOSNQUB63XB7N2IUHE6JPYZXD4QIN7HM X-Message-ID-Hash: YOSNQUB63XB7N2IUHE6JPYZXD4QIN7HM X-MailFrom: t.lamprecht@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Tue, 03 Nov 2026 16:52:23 +0100, Michael Köppl wrote: > A streamed response (e.g. for the single file restore download), has no > Content-Length nor chunked encoding, so the client can only tell where > the body ends by the connection being closed. The response accounced > 'Connection: Keep-Alive' and, at the end of the stream, push_shutdown() > shut down the socket directly, bypassing the TLS layer. The client then > receives a TCP FIN without a TLS close notify [0]. > > [...] Applied, with s/apiserver/response/ for the subject, thanks! [1/1] apiserver: send TLS close notify at the end of streamed responses commit: d4d74a6de412f9a946089cbfccec62b519557c73 Though in local tests the patch alone did not yet make the close notify a reliable end-of-download signal, so I applied three commits before it: - c2d96d0: with output still queued at the end of a stream, the close notify could only get queued and the following shutdown lost it. curl thus still failed with error 56 after receiving a complete download. - 7ba3802: a disconnect aborting a stream could send a close notify too, making a truncated download look complete. That goes back to 07e56cc, but clients can only rely on the close notify if it's not sent then. - 124c146: on a reused connection, a pipelined request could replace the source of an active stream, so the client received the other response as the body. With push_shutdown() gone, that could now end with a clean close notify too.