gnutls_bye(3)

πŸ’– gnutls_bye(3) β€” the gnutls girlie's guide to saying goodbye πŸ’–

okay so bestie, you're in the gnutls manual, page gnutls_bye(3), and this one is literally about ✨ending things✨ (the TLS connection, not the friendship, calm down 🫢).


✨ NAME ✨

gnutls_bye β€” API function

like... it's a function. in the API. that's the whole name situation πŸ’…


🌸 SYNOPSIS 🌸

#include <gnutls/gnutls.h>

int gnutls_bye(gnutls_session_t session, gnutls_close_request_t how);

look at her. two args. so simple. so iconic. πŸ‘‘


πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_session_t session β€” bestie this is a gnutls_session_t type. that's it, that's the arg.
  • gnutls_close_request_t how β€” and this one is an integer, no cap.

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so this function terminates the current TLS/SSL connection. periodt. the connection was supposed to have been started with gnutls_handshake() first β€” you can't break up with someone you never dated, iykyk 😭

how should be one of GNUTLS_SHUT_RDWR, GNUTLS_SHUT_WR. pick your goodbye energy:

  • In case of GNUTLS_SHUT_RDWR, the TLS session gets terminated and further receives and sends will be disallowed. if the return value is zero you may continue using the underlying transport layer. GNUTLS_SHUT_RDWR sends an alert containing a close request and waits for the peer to reply with the same message β€” it's giving mutual breakup, both parties agree πŸ’”
  • In case of GNUTLS_SHUT_WR, the TLS session gets terminated and further sends will be disallowed. in order to reuse the connection you should wait for an EOF from the peer. GNUTLS_SHUT_WR sends an alert containing a close request β€” one-sided, no waiting around, main character energy honestly 🌈
⚠️ real talk though: not all implementations will properly terminate a TLS connection. some of them, usually for performance reasons, will terminate only the underlying transport layer, and thus not distinguishing between a malicious party prematurely terminating the connection and normal termination. so like... the vibe check is genuinely unreliable here. the way that a bad actor can just dip and it looks exactly the same as a polite goodbye πŸ’€

this function may also return GNUTLS_E_AGAIN or GNUTLS_E_INTERRUPTED; cf. gnutls_record_get_direction().


⭐ RETURNS ⭐

GNUTLS_E_SUCCESS on success πŸŽ‰, or an error code β€” see function documentation for entire semantics.


πŸ› REPORTING BUGS πŸ›

found a bug? spill it to <bugs@gnutls.org>. they want the tea, fr fr. 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. slay, and legally so πŸ’œ


🌈 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, go forth and terminate your sessions responsibly πŸ’–

this has been gnutls_bye(3) from the gnutls manual, version 3.8.13 β€” thanks for reading the group chat, love u, bye πŸ‘‹βœ¨

πŸ“¦ where this page comes from