gnutls_session_set_verify_cert(3)
β¨ gnutls_session_set_verify_cert(3) β the gnutls manual, but make it make sense β¨
okay bestie, sit down, grab your boba π§ because we're talking about the gnutls manual page for gnutls_session_set_verify_cert(3). this one is lowkey important and highkey the vibe check your TLS client needs before it trusts literally anyone.
π NAME π
gnutls_session_set_verify_cert β it's an API function, periodt. β¨
π SYNOPSIS π
#include <gnutls/gnutls.h>
void gnutls_session_set_verify_cert(gnutls_session_t session, const char
* hostname, unsigned flags);
like, that's the whole signature. no cap. π«Ά
πΈ ARGUMENTS πΈ
gnutls_session_t sessionβ bestie this is a gnutls session, that's it, that's the whole description πconst char * hostnameβ the expected name of the peer. it may beNULL, she's flexible like that πunsigned flagsβ flags for certificate verification, specificallygnutls_certificate_verify_flagsπ
π¦ DESCRIPTION π¦
so here's the tea β: this function tells GnuTLS to verify the peer's certificate using the hostname you gave it. if the verification fails, the handshake ALSO FAILS β and it goes down with GNUTLS_E_CERTIFICATE_VERIFICATION_ERROR. yeah. it's giving dramatic π. in that case you can go get the verification result using gnutls_session_get_verify_cert_status().
now listen closely because this part matters: the hostname pointer you hand over must remain valid for the lifetime of the session. more precisely, it should still be around during any subsequent handshakes. like, don't let it ghost π». if you don't provide a hostname at all, then no hostname verification will be performed. and if you want a more advanced verification function, go check out gnutls_session_set_verify_cert2() β she's the upgraded version, main character energy fr fr.
if flags contains a profile, then this function should be called after any session priority setting functions. order matters bestie, we don't do chaos here (well, we do, but not in this specific case) π.
and the whole point: gnutls_session_set_verify_cert() is intended to be used by TLS clients to verify the server's certificate. that's her job. that's her purpose. iconic. π
β SINCE β
3.4.6 β she's been here a minute, respect the elders π
π REPORTING BUGS π
found a bug? don't be shy, tell the girlies:
- report bugs to <bugs@gnutls.org>
- home page:
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. slay, that's a very chill license, we love to see it π
π 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 whole page bestie!! this was gnutls_session_set_verify_cert(3) from the gnutls manual, version 3.8.13 β mwah π go verify some certificates, stay safe, and remember: never trust a peer without a vibe check. π«Άβ¨ππ¦
π¦ 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