GNUTLS_HANDSHAKE_SET_MAX_PACKET_LENGTH(3)
β¨ NAME β¨
gnutls_handshake_set_max_packet_length β bestie, this is the API function that puts a cap on how big your handshake messages are allowed to get π
(oh and hi, you're reading the gnutls manual, section 3, and this page is lowkey iconic π)
πΈ SYNOPSIS πΈ
#include <gnutls/gnutls.h>
void gnutls_handshake_set_max_packet_length(gnutls_session_t session,
size_t max);
π¦ ARGUMENTS π¦
gnutls_session_t sessionβ okay so this is literally just agnutls_session_ttype. Your session. Your girl. π«Άsize_t maxβ and this one? This is the maximum number. The ceiling. The limit. The "no more than this, periodt" value. β
π DESCRIPTION π
So the way that this function works is: it sets the maximum size of all handshake messages. If a handshake tries to come through over that size, it gets rejected β with the GNUTLS_E_HANDSHAKE_TOO_LARGE error code. Not me being dramatic, that's literally the error. π
The default value is 128kb, which is, ngl, typically large enough for basically everyone. Main character default behaviour.
And if you want no upper limit at all? Set this to 0. Zero. Nada. Free-range handshakes. π
The reason for restricting the handshake message sizes are to limit Denial of Service attacks. π‘οΈ
Which, yeah, makes total sense β this is a security vibe check, fr fr.
Also, heads up: note that the maximum handshake size was increased to 128kb from 48kb in GnuTLS 3.5.5. Glow-up era. π
π REPORTING BUGS π
Found a bug? Tell the girlies:
- Report bugs to <bugs@gnutls.org>.
- Home page: https://www.gnutls.org
π COPYRIGHT π
Copyright Β© 2001-2023 Free Software Foundation, Inc., and others.
Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved.
(so yes, you may absolutely copy this, just keep the receipts π§Ύβ¨)
π₯ SEE ALSO π₯
The full documentation for gnutls is maintained as a Texinfo manual. If the /usr/share/doc/gnutls/ directory does not contain the HTML form, visit
https://www.gnutls.org/manual/
okay that's the whole page, you ate that π stay safe, cap your handshakes, and don't let anybody DoS your vibe. mwah π
β gnutls, version 3.8.13, gnutls_handshake_set_max_packet_length(3), signing off π
π¦ where this page comes from
- alpine 3.22: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.23: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.24: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- arch rolling: gnutls 3.8.13-3 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- ubuntu stonking: gnutls-doc 3.8.13-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms