GNUTLS_CERTIFICATE_SET_X509_TRUST_FILE(3)

πŸ’– gnutls_certificate_set_x509_trust_file β€” the NAME section, bestie πŸ’–

gnutls_certificate_set_x509_trust_file β€” it's an API function, and it lives in the gnutls manual (section 3, the library-calls girlies πŸ’…).


✨ SYNOPSIS ✨

#include <gnutls/gnutls.h>

int
gnutls_certificate_set_x509_trust_file(gnutls_certificate_credentials_t
cred, const char * cafile, gnutls_x509_crt_fmt_t type);

okay so that's the whole shape of it, no cap 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_certificate_credentials_t cred β€” this is literally just a gnutls_certificate_credentials_t type. that's the vibe, that's the whole thing 🌸
  • const char * cafile β€” a file holding the list of trusted CAs. it can be a DER or PEM list. slay πŸ¦‹
  • gnutls_x509_crt_fmt_t type β€” is it PEM or DER? that's it, that's the question πŸ’…

πŸ’œ DESCRIPTION πŸ’œ

This function adds the trusted CAs, and the reason we're doing that is so we can verify client or server certificates. periodt.

In case of a client: you are not required to call this if the certificates aren't being verified using gnutls_certificate_verify_peers2(). and listen β€” this function may be called multiple times. yes bestie, you can stack it, it's giving ✨layers✨

In case of a server: the names of the CAs you set here get sent to the client if a certificate request is sent. and if you're like "ma'am I did not ask for that," you can disable it with gnutls_certificate_send_x509_rdn_sequence(). iconic opt-out πŸŽ€

okay and here's the fun part β€” this function can also accept URLs πŸ‘‘ In that case it will import all certificates that are marked as trusted. and ngl, the supported URLs are the ones indicated by gnutls_url_is_supported(). iykyk πŸ’…

πŸ”₯ RETURNS πŸ”₯

the number of certificates processed. that's the count, bestie, take it and go πŸ’–


😭 REPORTING BUGS 😭

found something cursed? Report bugs to <bugs@gnutls.org>. fr fr, they want to know.

Home page: https://www.gnutls.org


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. keep the receipt, that's all we ask πŸ™ˆ


🌈 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 3.8.13 energy, from your fave manual-page girlie πŸ’–βœ¨πŸ¦‹ take care of your trust files and your trust issues, mwah πŸ’…πŸŽ€

πŸ“¦ where this page comes from