gnutls_priority_init(3)

πŸ’– gnutls_priority_init(3) β€” the gnutls manual, but make it make sense πŸ’–

okay bestie, sit down, hydrate, because today we're learning how to tell GnuTLS what crypto vibes you want. this is gnutls_priority_init from the gnutls manual and she's a whole API function. ✨


🌸 NAME 🌸

gnutls_priority_init β€” literally the API function, that's her, that's the name πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <gnutls/gnutls.h>

int gnutls_priority_init(gnutls_priority_t * priority_cache, const char
* priorities, const char ** err_pos);

yes the line wrap in the header file is real, we don't gatekeep πŸ’…


✨ ARGUMENTS ✨

  • gnutls_priority_t * priority_cache β€” bestie this is a gnutls_priority_t type. that's the whole description. it's giving "the thing you're initializing" πŸ‘‘
  • const char * priorities β€” a string that describes your priorities. and yes, she can be NULL, she's flexible like that 🫢
  • const char ** err_pos β€” if something goes wrong, this lil guy gets the position in the string where the error happened. like a little "u messed up here" pin πŸ“

πŸ’œ DESCRIPTION πŸ’œ

okay so first things first, a real talk moment. if your app does not modify its crypto settings per release, pls consider using gnutls_priority_init2() with the GNUTLS_PRIORITY_INIT_DEF_APPEND flag instead. we're suggesting you let the GnuTLS library handle centralized crypto settings, and let apps just modify the default settings to their needs. it's the "don't do it yourself, it's handled" energy, no cap πŸ”₯

now the actual tea: this function is identical to gnutls_priority_init2() with zero flags. same girl, different door πŸšͺ

and listen β€” a NULL priorities string means the default priorities get used. iconic. this has been available since GnuTLS 3.3.0, so it's not new-new, it's just good. ⭐


πŸ’€ RETURNS πŸ’€

  • syntax error? you get GNUTLS_E_INVALID_REQUEST. rip 😭
  • success? GNUTLS_E_SUCCESS, slay πŸ’…
  • anything else? you get an error code, as one does.

πŸ™ˆ REPORTING BUGS πŸ™ˆ

found a bug? don't suffer in silence, tell the girlies:


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 like, go off, but 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/


and that's the whole page, bestie!! no notes, we ate πŸ“

this was gnutls 3.8.13, and the page is gnutls_priority_init(3) β€” mwah, go forth and set your priorities πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from