gnutls_error_to_alert(3)

✨ gnutls_error_to_alert ✨

okay bestie, welcome to gnutls_error_to_alert(3) β€” it's a page from the gnutls manual and honestly it's a little chaotic but we're gonna get through it together πŸ’–


🌸 NAME 🌸

gnutls_error_to_alert β€” literally an API function, that's the whole name, no notes πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <gnutls/gnutls.h>

int gnutls_error_to_alert(int err, int * level);

πŸ¦‹ ARGUMENTS πŸ¦‹

  • int err β€” a negative integer, bestie. negative. that's the vibe check it has to pass.
  • int * level β€” the alert level is gonna get stored right there in this pointer, so make sure it's pointing somewhere real πŸ‘‘

🌈 DESCRIPTION 🌈

So here's the tea: this function takes the error code that some gnutls function handed you and gives you back the matching alert. that's it, that's the job 🫢

⚠️ big important note: all alerts sent by this function should be considered FATAL. like, all of them. no cap.

the one single exception β€” the only one, the main character of exceptions β€” is when err is GNUTLS_E_REHANDSHAKE. in that one case, a warning alert should be sent to the peer, and the warning is basically saying "bestie, no renegotiation is happening, don't even ask" 😭

and if there's literally no mapping to a valid alert? then you get the alert that signals an internal error: GNUTLS_A_INTERNAL_ERROR. that's the fallback, periodt πŸ’€


⭐ RETURNS ⭐

the alert code you should use for a particular error code. that's the return value, slay ✨


πŸ› REPORTING BUGS πŸ›

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


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.

like... iconic of them honestly πŸŽ€


πŸ’œ 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, then go visit:

https://www.gnutls.org/manual/

and that's the whole page fr fr 🌸 this was gnutls_error_to_alert(3) from the gnutls manual, version 3.8.13, brought to you by the gnutls peeps. mwah, go ship something secure πŸ’–πŸ’…πŸ¦‹

πŸ“¦ where this page comes from