gnutls_certifi..._x509_trust_mem(3)
π gnutls_certifi..._x509_trust_mem(3) π
okay bestie, welcome to the gnutls manual, we're doing the β¨ trust store thing β¨ today. it's giving certificate authority energy. let's get into it π«Ά
β¨ NAME β¨
gnutls_certificate_set_x509_trust_mem β an API function, and honestly? a whole vibe. it's the one that sets up your trusted CAs straight from memory π
π SYNOPSIS π
#include <gnutls/gnutls.h>
int
gnutls_certificate_set_x509_trust_mem(gnutls_certificate_credentials_t
res, const gnutls_datum_t * ca, gnutls_x509_crt_fmt_t type);
like. look at her. she's so little and she does SO much π₯Ή
πΈ ARGUMENTS πΈ
gnutls_certificate_credentials_t resβ is agnutls_certificate_credentials_ttype. yes babe, that's the credentials object, the main character of this whole story πconst gnutls_datum_t * caβ is a list of trusted CAs or a DER certificate. so either a whole lil squad of CAs or just one single DER cert, dealer's choice β¨gnutls_x509_crt_fmt_t typeβ is DER or PEM. that's it, those are the two options, pick your format bestie π
π DESCRIPTION π
so what does she actually DO. this function adds the trusted CAs in order to verify client or server certificates. that's the whole job. that's the assignment. and she ate π₯
in case of a client, this is not required to be called if the certificates are not verified using gnutls_certificate_verify_peers2(). like, if you're not checking peers, you can just... not. no pressure, no stress π¦
also, this function may be called multiple times. so you can just keep stacking, keep adding, she'll take it all π
in case of a server, the CAs set here will be sent to the client if a certificate request is sent. so the server's like "hey client, here's who I trust π". and this can be disabled using gnutls_certificate_send_x509_rdn_sequence() if you're not feeling it.
β RETURNS β
the number of certificates processed β or a negative error code on error π
so if you get a negative number back, that's not a count, that's a situation. check it, bestie.
π REPORTING BUGS π
found a bug? not the cute kind? report it to <bugs@gnutls.org>. they wanna know fr fr π
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. so like, share it, remix it, just keep the receipts π§Ύβ¨
π 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/
go read it, i know you want to π
π reminder: this page is gnutls_certifi..._x509_trust_mem(3) β yes the title is truncated with the lil dots, that's just how the man page do. don't come for her.
and that's the whole page bestie!! this was gnutls version 3.8.13, so if you're reading this in some other version, lowkey check the docs. mwah, love u, go set some trusted CAs ππβ¨
π¦ 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