gnutls_session...output_function(3)

πŸ’– gnutls_session_set_verify_output_function β€” the API function that lives in the gnutls manual πŸ’–

okay so bestie, buckle up, we're doing a deep dive on gnutls_session_set_verify_output_function, which is an API function from the gnutls family. she's niche, she's specific, and she's gonna be your new obsession fr fr.


✨ SYNOPSIS ✨

#include <gnutls/x509.h>

void gnutls_session_set_verify_output_function(gnutls_session_t session,
gnutls_verify_output_function * func);

that's the whole vibe. one include, one function, no drama πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_session_t session β€” bestie, this one is a gnutls_x509_trust_list_t type. yes that's what the docs say, no I'm not changing it, I don't make the rules πŸ™ˆ
  • gnutls_verify_output_function * func β€” this is the callback function. the main character, honestly.

🌸 DESCRIPTION 🌸

okay so here's the tea β˜•. This function sets a callback that gets called when the peer's certificate chain has to be verified and the full path to the trusted root has to be printed. both things. at once. she's multi-tasking.

the callback's function prototype is defined in x509.h, and it's giving:

int (*callback)( gnutls_x509_crt_t cert, gnutls_x509_crt_t issuer,
gnutls_x509_crl_t crl, unsigned int verification_output);

so if you hand over a callback function, gnutls will call it β€” inside the certificate verification procedure, no less. ✨

and to verify the certificate chain and print its path uptp the trusted root, you can use functions like:

  • gnutls_certificate_verify_peers()
  • gnutls_x509_trust_list_verify_crt()
  • gnutls_x509_trust_list_verify_crt2()

the callback is set in _gnutls_verify_crt_status() and _gnutls_pkcs11_verify_crt_status(). that's where the magic happens, iykyk πŸ”₯


⭐ SINCE ⭐

3.7.0 β€” so she's been around a minute, she's not new here, she's a legacy icon πŸ‘‘


πŸ¦‹ REPORTING BUGS πŸ¦‹

found something sus? not me gatekeeping this:

they literally want to hear from you, bestie 🫢


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.

(translation: you can share this file, just keep the copyright notice and this notice intact. the lawyers said so, and honestly? slay for open source 🌈)


🌟 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 visit:

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

and that's the whole page, no notes, periodt πŸ’…

signing off from the gnutls manual, version 3.8.13, dated alongside gnutls_session...output_function(3) β€” stay verified, stay iconic, and remember: trust the root, not the vibes πŸŽ€βœ¨

πŸ“¦ where this page comes from