gnutls_session_set_verify_cert2(3)
π gnutls_session_set_verify_cert2 π
okay bestie, welcome to the gnutls manual, section 3 β yes that's the C library function section, iykyk. today's main character is gnutls_session_set_verify_cert2, and she's the one who tells GnuTLS to check the peer's cert with your own β¨custom typed dataβ¨. let's get into it π«Ά
β¨ NAME β¨
gnutls_session_set_verify_cert2 β API function π
πΈ SYNOPSIS πΈ
#include <gnutls/gnutls.h>
void gnutls_session_set_verify_cert2(gnutls_session_t session,
gnutls_typed_vdata_st * data, unsigned elements, unsigned flags);
no return value, she just does it. periodt.
π ARGUMENTS π
gnutls_session_t sessionβ bestie. it's a gnutls session. the whole vibe happens in here.gnutls_typed_vdata_st * dataβ an array of typed data. like, the actual info you want the verification to care about πunsigned elementsβ how many data elements are in that array. count them, fr fr.unsigned flagsβ flags for certificate verification, i.e.gnutls_certificate_verify_flags. this is where you get to be picky.
π DESCRIPTION π
so basically this function tells GnuTLS to verify the peer's certificate using the typed data info you provided. no cap. π¦
and if the verification fails? the handshake also fails, with GNUTLS_E_CERTIFICATE_VERIFICATION_ERROR. and then, because we love a follow-up, you can go grab the verification result with gnutls_session_get_verify_cert_status(). π₯
the acceptable typed data are literally the same ones as in gnutls_certificate_verify_peers(). and once you've set them, they must stay valid for the lifetime of the session. more precisely β they should be available during any subsequent handshakes. so don't go freeing that memory mid-relationship, okay? π
also, if flags is provided and it contains a profile, you need to call this function after any session priority setting functions. order matters, bestie. that's the rule.
β SINCE β
3.4.6 β an oldie but a goodie, she's been iconic for a minute.
π REPORTING BUGS π
found a bug? spill it to <bugs@gnutls.org>. they wanna know. π
home page: https://www.gnutls.org β go say hi.
π 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. (slay, that's a generous license honestly π«Ά)
π 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, go visit
https://www.gnutls.org/manual/
and that's the whole page, bestie!! π
this one came to you from gnutls 3.8.13, and it's the gnutls_session_set_verify_cert2 page β stay verified, stay valid for the lifetime of the session, and don't forget to free nothing early. bye babe πβ¨ππ¦
π¦ 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