GNUTLS_CERTIFICATE_SET_VERIFY_FUNCTION(3)
π gnutls_certificate_set_verify_function β API function π
okay bestie, pull up a chair, because this one is from the gnutls manual (that's the GNU TLS library, she's iconic, she's giving secure-transport main character energy) and we're gonna talk about her in full. no skipping, no summarizing, we're doing the whole thing. π
β¨ NAME β¨
gnutls_certificate_set_verify_function β it's an API function, fr fr. that's literally her whole job title. π
πΈ SYNOPSIS πΈ
#include <gnutls/gnutls.h>
void
gnutls_certificate_set_verify_function(gnutls_certificate_credentials_t
cred, gnutls_certificate_verify_function * func);
not her returning anything cute btw, she's void. she just does the thing and leaves. periodt. π
π¦ ARGUMENTS π¦
gnutls_certificate_credentials_t credβ this one is agnutls_certificate_credentials_ttype. that's it, that's the whole vibe. your credentials, your little bundle of trust. π«Άgnutls_certificate_verify_function * funcβ this is the callback function. the star of the show. the one who gets called. β
π DESCRIPTION π
so the way this works β you're setting a callback that gnutls will hit up when the peer's certificate shows up, so it gets verified on receipt instead of you sitting around waiting until after the whole handshake is done. like, why wait when you could just verify right then? exactly. no cap. π₯
the callback's function prototype is literally:
int (*callback)(gnutls_session_t);
and if you do hand over a callback function, gnutls will call it during the handshake, right after the certificate message has been received. so it's early, it's eager, it's on top of things. π
and if you wanna verify or grab the certificate while you're in there, these are the functions you can use:
gnutls_certificate_verify_peers2()gnutls_certificate_type_get()gnutls_certificate_get_peers()
and now the important part, bestie, do not skip this one:
your callback function needs to return 0 for the handshake to keep going, or non-zero to terminate it. zero = we ball, non-zero = shut it down. that's the whole decision. π
β³ SINCE β³
2.10.0 β she's been around, she's seasoned, she's not new here. π
π REPORTING BUGS π
found a bug? tell the people, they wanna know:
- report bugs to
<bugs@gnutls.org> - home page:
https://www.gnutls.org
π COPYRIGHT π
Copyright Β© 2001-2023 Free Software Foundation, Inc., and others.
and the license tea, since we always give credit where it's due: 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 like, go off, just keep the receipts. π
π SEE ALSO π
the full documentation for gnutls is maintained as a Texinfo manual. so if the /usr/share/doc/gnutls/ directory isn't giving HTML form for you, go visit:
https://www.gnutls.org/manual/
that's where the full lore lives. iykyk. π
and that's the whole page, bestie!! this one came from gnutls version 3.8.13 in the gnutls manual β go forth and verify those certificates early, you absolute legend. mwah. π
β¨ππ¦πΈπ
π¦ 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