gnutls_transport_set_fastopen(3)
β¨ gnutls_transport_set_fastopen β¨
okay bestie so this one is from the gnutls manual, and it's literally an API function, which is the most iconic genre of function there is π
πΈ NAME πΈ
gnutls_transport_set_fastopen β an API function, periodt.
π¦ SYNOPSIS π¦
#include <gnutls/socket.h>
void gnutls_transport_set_fastopen(gnutls_session_t session, int fd,
struct sockaddr * connect_addr, socklen_t connect_addrlen, unsigned int
flags);
π ARGUMENTS π
gnutls_session_t sessionβ bestie this is agnutls_session_ttype, that's the whole vibe.int fdβ the session's socket descriptor π«Άstruct sockaddr * connect_addrβ the address we wanna connect to, the destination, the place we're going β¨socklen_t connect_addrlenβ the length ofconnect_addr, gotta know how big it isunsigned int flagsβ must be zero. that's it. zero. no notes. π«
π DESCRIPTION π
So this function enables TCP Fast Open (TFO) for the TLS client session you point it at π₯ and like, what even is TFO? it means the TCP connection establishment and the transmission of the first TLS client hello packet get combined into one glorious moment. two things, one step, slay.
The peer's address has to be specified in connect_addr and connect_addrlen, obvi. and the socket specified by fd should not be connected β like, leave it unconnected, that's the point.
TFO only works for TCP sockets of type AF_INET and AF_INET6. that's the whole list, no cap.
And if your OS doesn't support TCP fast open? no biggie, the function will result in gnutls using connect() transparently during the first write. it just handles it for you, lowkey iconic of it honestly.
π NOTE π
heads up bestie, this part matters.
This function overrides all the transport callback functions. the way that it just takes over everything π if that's undesirable to you, then TCP Fast Open must be implemented on the user callback functions without calling this function. iykyk.
When using this function, transport callbacks must not be set, and gnutls_transport_set_ptr() or gnutls_transport_set_int() must not be called. do not do it. don't even think about it π
On GNU/Linux, TFO has to be enabled at the system layer, that is in /proc/sys/net/ipv4/tcp_fastopen, bit 0 has to be set. so like, go set bit 0 if you want this to actually work π
Also: this function has no effect on server sessions. server girlies, this is not for you. sorry not sorry.
β SINCE β
3.5.3 β vintage, but make it fast open.
π REPORTING BUGS π
Report bugs to <bugs@gnutls.org>. they want to hear from you fr fr.
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. yes bestie, go forth and distribute β¨
π 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/
and that's the whole page, no crumbs left π this was gnutls version 3.8.13, the gnutls_transport_set_fastopen(3) page β mwah, take care of her π
π¦ 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