gnutls_protocol_set_enabled(3)
π gnutls_protocol_set_enabled β the gnutls manual, bestie edition π
okay so real talk, this is a page from the gnutls manual (section 3, the library-call girlies) and it's about gnutls_protocol_set_enabled(3) β the function that lets you flip a TLS protocol version on or off before everything else wakes up. let's get into it π«Ά
β¨ NAME β¨
gnutls_protocol_set_enabled β it's an API function, that's the whole vibe. no cap.
πΈ SYNOPSIS πΈ
#include <gnutls/gnutls.h>
int gnutls_protocol_set_enabled(gnutls_protocol_t version, unsigned int
enabled);
there she is π
π ARGUMENTS π
gnutls_protocol_t versionβ bestie this is a (gnutls) version number. like, which protocol version we're talking about.unsigned int enabledβ and this one is literally just whether to enable the protocol or not. yes/no energy. π¦
π DESCRIPTION π
so what does it do? it controls the previous system-wide setting that marked version as enabled or disabled. think of it as reaching back and editing the defaults your system already decided on. β¨
but β and this is the important part, don't skip it β calling this function is allowed only if allowlisting mode is set in the configuration file, and only if the system-wide TLS priority string has not been initialized yet. both conditions. no exceptions. π
the intended usage is to give applications a way to expressly deviate from the distribution or site defaults that they inherited from the configuration file. you're not fighting the config, you're just... respectfully disagreeing with it. and the modification is composable with further modifications performed through the priority string mechanism, so it plays nice with the other knobs. π
π¨ ok this one matters: this function is not thread-safe and is intended to be called in the main thread at the beginning of the process execution. not in some random worker thread halfway through your app's life. main thread, top of main, that's the moment. periodt.
β RETURNS β
0 on success or negative error code otherwise. zero means slay, negative means something went sideways. π₯
π¦ SINCE π¦
3.7.3 β been here since then, iconic behavior. π
π REPORTING BUGS π
found a bug? don't suffer in silence, tell the people:
- 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. (yes bestie, keep the notice, that's the deal π«Ά)
π 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/
that's the whole page, fr fr. this one came from gnutls 3.8.13 β thanks for reading, go call it from your main thread at the start of the process like a good little main character πβ¨πΈ
π¦ 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