NNG_TLS_CONFIG_CA_FILE(3tls)

πŸ“¦
version 1.12.0 Β· 4 versions
, in ubuntu stonking

🌸 NNG_TLS_CONFIG_CA_FILE β€” it's from the NNG Reference Manual bestie 🌸

✨ NAME ✨

nng_tls_config_ca_file β€” load certificate authority from file, no cap πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

#include <nng/nng.h>
#include <nng/supplemental/tls/tls.h>

int nng_tls_config_ca_file(nng_tls_config *cfg, const char *path);

πŸ’… DESCRIPTION πŸ’…

okay so nng_tls_config_ca_file() is the glow-up your TLS config needs πŸ’– it sets up the certificate authority certificate chain and the optional revocation list by loading the certificates (and the revocation list, if there even is one) out of a single named file.

that file has to have at least one X.509 certificate in PEM format (the RFC 7468 kind, iykyk πŸ“œ), and it's totally allowed to hold multiple of those certificates, plus zero or more PEM CRL objects. all that info is what gets used to validate the certificates your peers hand over when you're using the configuration cfg. validating peers? slay. πŸ”₯

Note 🫢 Certificates must be configured when you're using the authentication mode NNG_TLS_AUTH_MODE_REQUIRED. like, mandatory mandatory.
Tip ✨ You can call this function multiple times to add extra chains onto a configuration without messing with the ones you already added. stacking chains, main character behavior πŸ‘‘

🌈 RETURN VALUES 🌈

this one returns 0 on success, and non-zero otherwise. simple as that πŸ’…


πŸ’€ ERRORS πŸ’€

  • NNG_ENOMEM β€” not enough memory available, it's giving starving 😭
  • NNG_EBUSY β€” the configuration cfg is already in use and cannot be modified. she's taken, back off πŸ™ˆ
  • NNG_EINVAL β€” the contents of path are invalid, or they just don't contain a valid PEM certificate. not it. πŸ’€
  • NNG_ENOENT β€” the file path does not exist. ghosted fr fr πŸ‘»
  • NNG_EPERM β€” the file path is not readable. permission denied bestie 🚫

πŸ¦‹ SEE ALSO πŸ¦‹

nng_strerror(3), nng_tls_config_alloc(3tls), nng_tls_config_auth_mode(3tls), nng_tls_config_ca_chain(3tls), nng(7)


and that's the whole page, you ate it up πŸ’…βœ¨ this was the NNG Reference Manual, living under the name NNG_TLS_CONFIG_CA_FILE(3tls), dated 2026-06-30. go forth and validate those peers, icon πŸ’–πŸŽ€πŸ¦‹πŸŒΈπŸ«Ά

πŸ“¦ where this page comes from