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 agnutls_x509_trust_list_ttype. 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:
- report bugs to <bugs@gnutls.org>
- home page: https://www.gnutls.org
they literally want to hear from you, bestie π«Ά
π COPYRIGHT π
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
- alpine 3.22: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.23: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.24: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- arch rolling: gnutls 3.8.13-3 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- ubuntu stonking: gnutls-doc 3.8.13-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms