GNUTLS_SESSION_SET_VERIFY_FUNCTION(3)
π NAME π
gnutls_session_set_verify_function β the API function that lets you check a peer's certificate the moment it shows up, bestie π
This is a page from the gnutls manual, section 3 (library calls). Yes it's a C library, no it's not scary, we're doing this together π«Ά
β¨ SYNOPSIS β¨
#include <gnutls/gnutls.h>
void gnutls_session_set_verify_function(gnutls_session_t session,
gnutls_certificate_verify_function * func);
okay so like. two things go in. nothing comes out. void, she's mysterious like that π
π ARGUMENTS π
gnutls_session_t sessionβ bestie this is literally just agnutls_session_ttype. that's the whole thing. that's the arg.gnutls_certificate_verify_function * funcβ and this one is the callback function, aka the little guy that gets called to do the verifying π
πΈ DESCRIPTION πΈ
Okay so here's the tea β β this function sets a callback that gets called when the peer's certificate has been received, so you can verify it on receipt instead of waiting around until after the handshake is done. the way that saves you time... iconic behavior honestly.
Heads up: this overrides any callback you already set using gnutls_certificate_set_verify_function(). so if you set one there and then set one here, this one wins. periodt π
The callback's function prototype is:
int (*callback)(gnutls_session_t);
If you do hand over a callback function, then gnutls will call it in the handshake, right after the certificate message has been received. β¨
And to verify or obtain the certificate, you can use these cuties:
gnutls_certificate_verify_peers2()gnutls_certificate_type_get()gnutls_certificate_get_peers()
And the callback function should return 0 for the handshake to continue, or non-zero to terminate. that's it. that's the whole vibe check β 0 = keep going, non-zero = we're done here π
β SINCE β
3.4.6 β she's been around, she's established, she's got lore π
π¦ REPORTING BUGS π¦
Found a bug? Not me finding a bug π report it to <bugs@gnutls.org>.
Home page is over at <https://www.gnutls.org> π
π 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. fr fr, go off, share it, just keep the notice π«Ά
π 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 page bestie, no cap π this was gnutls version 3.8.13, manual page gnutls_session_set_verify_function(3), serving looks as always. go forth and verify those certs on receipt, you absolute main character ππ
π¦ 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