gnutls_alert_send(3)

✨ gnutls_alert_send ✨

okay bestie, so this page is from the gnutls manual β€” yes, that gnutls, the TLS library that's carrying the entire secure-internet situation on its back πŸ’… β€” and today's main character is gnutls_alert_send(3). it's an API function. it says what it does on the tin. let's get into it 🫢


🌸 SYNOPSIS 🌸

#include <gnutls/gnutls.h>

int gnutls_alert_send(gnutls_session_t session, gnutls_alert_level_t
level, gnutls_alert_description_t desc);

so you pull in <gnutls/gnutls.h> first (obviously, it's giving "include me or perish"), and then you get one little function with three lil args. that's it. that's the whole vibe check πŸ¦‹


πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_session_t session β€” the session, babes. it's a gnutls_session_t type. that's literally the whole description. slay, concise queen πŸ‘‘
  • gnutls_alert_level_t level β€” how serious we're being rn. this is the level of the alert 🌈
  • gnutls_alert_description_t desc β€” the actual tea being spilled. this is the alert description πŸ“

πŸ’– DESCRIPTION πŸ’–

so what does it do? it sends an alert to the peer, like, to let them know something important happened β€” for example, that their Certificate could not be verified. not me snitching on the cert 😭

and here's the important part, so listen up: if the alert level is Fatal, then the peer is expected to close the connection. periodt. no takebacks. but if it's not Fatal, the peer may just ignore the alert and keep going like nothing happened. iconic "read at 4:04pm" energy ngl πŸ’€

also β€” and this is the detail everyone forgets β€” the error code of the underlying record send function is what gets returned. so don't be surprised if you also receive GNUTLS_E_INTERRUPTED or GNUTLS_E_AGAIN in the mix. it's not a bug bestie, it's just the send function being itself πŸ™ˆ


⭐ RETURNS ⭐

on success you get GNUTLS_E_SUCCESS (which is 0) πŸŽ‰ and otherwise you get an error code. that's the whole returns section. short, sweet, and honest. we love that for her πŸ’œ


😭 REPORTING BUGS 😭

found a bug? do NOT suffer in silence, tell the girlies:

fr fr, they want to hear from you 🫢


Copyright Β© 2001-2023 Free Software Foundation, Inc., and others.

and the license part, verbatim-ish but still slaying: 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 go forth and share it, queen, just 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, go visit:

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

that's the link. that's the destination. click it, bestie ✨


and that's the whole page! this one came from gnutls version 3.8.13, the gnutls manual, gnutls_alert_send(3). go send some alerts responsibly, drink water, and remember: Fatal means close the connection πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from