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 Β© 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