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:


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