gnutls_init(3)
π gnutls_init(3) π
okay bestie, welcome to the gnutls manual, section 3 β this one's all about gnutls_init, and it's genuinely the glow-up moment where your session gets born β¨
πΈ NAME πΈ
gnutls_init β API function. that's it, that's the name, she's serving function energy π
β¨ SYNOPSIS β¨
#include <gnutls/gnutls.h>
int gnutls_init(gnutls_session_t * session, unsigned int flags);
π ARGUMENTS π
gnutls_session_t * sessionβ bestie this is a pointer to agnutls_session_ttype. it's the lil vessel your whole session is about to live in π«Άunsigned int flagsβ these tell us whether this session is gonna be used for a server or a client. yes ma'am, we're picking a lane π
π¦ DESCRIPTION π¦
so this function initializes the provided session. every session must be initialized before use β no skipping, no shortcuts, that's the rule β and after a successful initialization and use, it must be deinitialized by calling gnutls_deinit(). clean up after yourself, it's giving responsible queen π
the flags can be any combination of flags from gnutls_init_flags_t. mix and match, go wild, it's your world π
note that since version 3.1.2, this function enables some common TLS extensions such as session tickets and OCSP certificate status request on the client side by default. if you don't want that (fair), use the GNUTLS_NO_DEFAULT_EXTENSIONS flag to shut it down π
and now the part that lowkey matters: it is never mandatory to use gnutls_deinit() after this function fails. periodt. since gnutls 3.8.0, it is safe to unconditionally use gnutls_deinit() even after failure β regardless of whether the memory was initialized prior to gnutls_init(). icon behavior, honestly π₯
however, clients wanting to be portable to older versions of the library should either:
- skip deinitialization on failure, or
- pre-initialize the memory passed in to
gnutls_init()to all zeroes viamemset()or similar.
that's the vibe check. old library versions are not it, protect yourself π
β RETURNS β
GNUTLS_E_SUCCESS on success, or an error code. that's it. that's the whole mood π
π REPORTING BUGS π
found a bug? don't gatekeep, report it:
- 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.
(translation: share it, remix it, just keep the receipts, bestie π§Ύπ)
π 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/
go read it, iykyk πβ¨
and that's the whole page, bestie!! π this was gnutls_init(3) from the gnutls manual, version 3.8.13 β mwah, love u, go initialize some sessions responsibly ππΈπ¦
π¦ 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