NNG_TLS_CONFIG_CA_FILE(3tls)
πΈ 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 configurationcfgis already in use and cannot be modified. she's taken, back off πNNG_EINVALβ the contents ofpathare invalid, or they just don't contain a valid PEM certificate. not it. πNNG_ENOENTβ the filepathdoes not exist. ghosted fr fr π»NNG_EPERMβ the filepathis 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
- ubuntu stonking: libnng-dev 1.12.0-1 Β· MIT OR Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms