From unknown Tue Aug 19 23:13:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#22966: HTTPS with GnuTLS's 'session-record-port' is inefficient Resent-From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Wed, 09 Mar 2016 22:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 22966 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 22966@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.145756096117398 (code B ref -1); Wed, 09 Mar 2016 22:03:02 +0000 Received: (at submit) by debbugs.gnu.org; 9 Mar 2016 22:02:41 +0000 Received: from localhost ([127.0.0.1]:41918 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1admBl-0004WY-FX for submit@debbugs.gnu.org; Wed, 09 Mar 2016 17:02:41 -0500 Received: from eggs.gnu.org ([208.118.235.92]:55569) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1admBj-0004WL-Jw for submit@debbugs.gnu.org; Wed, 09 Mar 2016 17:02:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1admBd-000630-NW for submit@debbugs.gnu.org; Wed, 09 Mar 2016 17:02:34 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:40936) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1admBd-00062v-Kx for submit@debbugs.gnu.org; Wed, 09 Mar 2016 17:02:33 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46521) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1admBc-0007q7-OT for bug-guix@gnu.org; Wed, 09 Mar 2016 17:02:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1admBX-000619-Ky for bug-guix@gnu.org; Wed, 09 Mar 2016 17:02:32 -0500 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:48441) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1admBX-000610-IO for bug-guix@gnu.org; Wed, 09 Mar 2016 17:02:27 -0500 Received: from reverse-83.fdn.fr ([80.67.176.83]:34006 helo=pluto) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1admBW-0002CH-U1 for bug-guix@gnu.org; Wed, 09 Mar 2016 17:02:27 -0500 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 20 =?UTF-8?Q?Vent=C3=B4se?= an 224 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x3D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-unknown-linux-gnu Date: Wed, 09 Mar 2016 23:02:24 +0100 Message-ID: <87fuvz9uof.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) (guix build download) uses =E2=80=98session-record-port=E2=80=99 from (gnut= ls), which returns a port to conveniently write to/read from the TLS session=E2=80=99s =E2=80=9Crecord=E2=80=9D layer. The problem is that every write to the port, that is, every call to =E2=80=98write_to_session_record_port=E2=80=99 in the GnuTLS bindings, lead= s to the creation of one =E2=80=9CApplication Data=E2=80=9D packet. For instance, when (web requests) writes an HTTP GET request, it roughly does: (display "GET" port) (display " " port) (display uri port) (display "\n\r" port) =E2=80=A6 it ends up creating a lot of small Application Data packets. When debugging is enabled in (guix build download), that translates to things like: gnutls: [14594|5] REC[0x152c9c0]: Preparing Packet Application Data(23) w= ith length: 1 and min pad: 0 gnutls: [14594|9] ENC[0x152c9c0]: cipher: AES-128-GCM, MAC: AEAD, Epoch: 1 gnutls: [14594|5] REC[0x152c9c0]: Sent Packet[4] Application Data(23) in = epoch 1 and length: 30 Terribly suboptimal. The difficulty is that the session record port doesn=E2=80=99t do any cachi= ng by itself, and it shouldn=E2=80=99t, because it=E2=80=99s the application=E2= =80=99s responsibility. So we might have to do our own caching and/or use =E2=80=98record-send=E2= =80=99 and =E2=80=98record-receive!=E2=80=99 instead of =E2=80=98session-record-port= =E2=80=99. Ludo=E2=80=99. From unknown Tue Aug 19 23:13:18 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Subject: bug#22966: closed (Re: bug#22966: HTTPS with GnuTLS's 'session-record-port' is inefficient) Message-ID: References: <87shzrsk0v.fsf@gnu.org> <87fuvz9uof.fsf@gnu.org> X-Gnu-PR-Message: they-closed 22966 X-Gnu-PR-Package: guix Reply-To: 22966@debbugs.gnu.org Date: Tue, 15 Mar 2016 17:56:01 +0000 Content-Type: multipart/mixed; boundary="----------=_1458064561-2434-1" This is a multi-part message in MIME format... ------------=_1458064561-2434-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #22966: HTTPS with GnuTLS's 'session-record-port' is inefficient which was filed against the guix package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 22966@debbugs.gnu.org. --=20 22966: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D22966 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1458064561-2434-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 22966-done) by debbugs.gnu.org; 15 Mar 2016 17:55:59 +0000 Received: from localhost ([127.0.0.1]:49343 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aftCJ-0000d2-4F for submit@debbugs.gnu.org; Tue, 15 Mar 2016 13:55:59 -0400 Received: from eggs.gnu.org ([208.118.235.92]:43492) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aftCH-0000cq-2a for 22966-done@debbugs.gnu.org; Tue, 15 Mar 2016 13:55:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aftC7-0000gV-HV for 22966-done@debbugs.gnu.org; Tue, 15 Mar 2016 13:55:51 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39881) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aftC7-0000gM-Dj for 22966-done@debbugs.gnu.org; Tue, 15 Mar 2016 13:55:47 -0400 Received: from reverse-83.fdn.fr ([80.67.176.83]:35868 helo=pluto) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aftC6-00020H-Ku for 22966-done@debbugs.gnu.org; Tue, 15 Mar 2016 13:55:47 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: 22966-done@debbugs.gnu.org Subject: Re: bug#22966: HTTPS with GnuTLS's 'session-record-port' is inefficient References: <87fuvz9uof.fsf@gnu.org> Date: Tue, 15 Mar 2016 18:55:44 +0100 In-Reply-To: <87fuvz9uof.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Wed, 09 Mar 2016 23:02:24 +0100") Message-ID: <87shzrsk0v.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 22966-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) ludo@gnu.org (Ludovic Court=C3=A8s) skribis: > The problem is that every write to the port, that is, every call to > =E2=80=98write_to_session_record_port=E2=80=99 in the GnuTLS bindings, le= ads to the > creation of one =E2=80=9CApplication Data=E2=80=9D packet. Guix commit ec278439f3ff5dcd3d02c05099ba1724cc2459f1 works around it in =E2=80=98guix substitute=E2=80=99. GnuTLS commit 0b1c136947878ccb600b4fa785ef257909104144 explains this in the guile-gnutls manual. I consider this bug closed. Ludo=E2=80=99. ------------=_1458064561-2434-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 9 Mar 2016 22:02:41 +0000 Received: from localhost ([127.0.0.1]:41918 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1admBl-0004WY-FX for submit@debbugs.gnu.org; Wed, 09 Mar 2016 17:02:41 -0500 Received: from eggs.gnu.org ([208.118.235.92]:55569) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1admBj-0004WL-Jw for submit@debbugs.gnu.org; Wed, 09 Mar 2016 17:02:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1admBd-000630-NW for submit@debbugs.gnu.org; Wed, 09 Mar 2016 17:02:34 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:40936) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1admBd-00062v-Kx for submit@debbugs.gnu.org; Wed, 09 Mar 2016 17:02:33 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46521) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1admBc-0007q7-OT for bug-guix@gnu.org; Wed, 09 Mar 2016 17:02:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1admBX-000619-Ky for bug-guix@gnu.org; Wed, 09 Mar 2016 17:02:32 -0500 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:48441) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1admBX-000610-IO for bug-guix@gnu.org; Wed, 09 Mar 2016 17:02:27 -0500 Received: from reverse-83.fdn.fr ([80.67.176.83]:34006 helo=pluto) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1admBW-0002CH-U1 for bug-guix@gnu.org; Wed, 09 Mar 2016 17:02:27 -0500 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: bug-guix@gnu.org Subject: HTTPS with GnuTLS's 'session-record-port' is inefficient X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 20 =?utf-8?Q?Vent=C3=B4se?= an 224 de la =?utf-8?Q?R?= =?utf-8?Q?=C3=A9volution?= X-PGP-Key-ID: 0x3D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-unknown-linux-gnu Date: Wed, 09 Mar 2016 23:02:24 +0100 Message-ID: <87fuvz9uof.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) (guix build download) uses =E2=80=98session-record-port=E2=80=99 from (gnut= ls), which returns a port to conveniently write to/read from the TLS session=E2=80=99s =E2=80=9Crecord=E2=80=9D layer. The problem is that every write to the port, that is, every call to =E2=80=98write_to_session_record_port=E2=80=99 in the GnuTLS bindings, lead= s to the creation of one =E2=80=9CApplication Data=E2=80=9D packet. For instance, when (web requests) writes an HTTP GET request, it roughly does: (display "GET" port) (display " " port) (display uri port) (display "\n\r" port) =E2=80=A6 it ends up creating a lot of small Application Data packets. When debugging is enabled in (guix build download), that translates to things like: gnutls: [14594|5] REC[0x152c9c0]: Preparing Packet Application Data(23) w= ith length: 1 and min pad: 0 gnutls: [14594|9] ENC[0x152c9c0]: cipher: AES-128-GCM, MAC: AEAD, Epoch: 1 gnutls: [14594|5] REC[0x152c9c0]: Sent Packet[4] Application Data(23) in = epoch 1 and length: 30 Terribly suboptimal. The difficulty is that the session record port doesn=E2=80=99t do any cachi= ng by itself, and it shouldn=E2=80=99t, because it=E2=80=99s the application=E2= =80=99s responsibility. So we might have to do our own caching and/or use =E2=80=98record-send=E2= =80=99 and =E2=80=98record-receive!=E2=80=99 instead of =E2=80=98session-record-port= =E2=80=99. Ludo=E2=80=99. ------------=_1458064561-2434-1--