gnutls_alert_send_appropriate(3)

πŸ’… gnutls_alert_send_appropriate πŸ’…

okay bestie, so this one lives in the gnutls manual, and it's the function that's like... the polite friend who knows exactly how to say "hey, something's wrong" in the right tone. It's giving emotional intelligence but for TLS alerts. 🫢


✨ NAME ✨

gnutls_alert_send_appropriate β€” API function


🌸 SYNOPSIS 🌸

#include <gnutls/gnutls.h>

int gnutls_alert_send_appropriate(gnutls_session_t session, int err);

πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_session_t session β€” bestie this is a gnutls_session_t type. that's it, that's the whole description, no cap.
  • int err β€” this is an error code that some other GnuTLS function handed back to you. like, you got a bad vibe from a function and now you're passing that vibe along.

πŸ’– DESCRIPTION πŸ’–

So what it does is: it sends an alert to the peer, and which alert it sends depends on the error code that a gnutls function gave you. Internally it will call gnutls_error_to_alert() to figure out the appropriate alert to send. like it does the social math for you. ✨

This function may also return GNUTLS_E_AGAIN, or GNUTLS_E_INTERRUPTED. periodt.

ok so here's the lore, and it matters: this function historically was always sending an alert to the peer, even if err was inappropriate to respond with an alert β€” for example GNUTLS_E_SUCCESS. 😭 that's like texting "we need to talk" after a totally normal conversation. Since 3.6.6 though, this function returns success without transmitting any data on error codes that should not result to an alert. glow up honestly. πŸ‘‘

⭐ RETURNS ⭐

On success, GNUTLS_E_SUCCESS (0) is returned, otherwise an error code is returned. simple as that, no crumbs. πŸ’œ


πŸ™ˆ REPORTING BUGS πŸ™ˆ

Found something cursed? Report bugs to <bugs@gnutls.org>. πŸ“§

Home page: https://www.gnutls.org


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.


πŸ¦‹ 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 πŸ’– it came from gnutls 3.8.13, dated like the footer says, and it's the gnutls_alert_send_appropriate(3) page β€” go send some appropriate alerts, you absolute icon. πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from