NNG_TLS_CONFIG_CA_CHAIN(3tls)
π nng_tls_config_ca_chain β the NNG Reference Manual, but make it a group chat π
okay bestie, pull up a chair because we're configuring certificate authority chains and honestly? it's giving trust issues but make them cryptographic π
β¨ NAME β¨
nng_tls_config_ca_chain β configure certificate authority certificate chain π
πΈ SYNOPSIS πΈ
#include <nng/nng.h>
#include <nng/supplemental/tls/tls.h>
int nng_tls_config_ca_chain(nng_tls_config *cfg, const char *chain, const char *crl);
π¦ DESCRIPTION π¦
so the way that nng_tls_config_ca_chain() works is: it sets up a certificate, or a whole certificate chain, that gets used to validate peers β and it does that using the configuration cfg. like, this is the "who do I actually trust" list, no cap. π
Note β bestie, if you're running the authentication mode NNG_TLS_AUTH_MODE_REQUIRED, you must configure certificates. it's not optional, it's the vibe check. not having them configured = no trust = no handshake. π
Tip β you can call this function multiple times to add more chains to a configuration, and it will not mess with the ones you added before. stacking trust like it's layer cake π
the certificates sitting in chain have to be a zero-terminated C string in PEM format (PEM = the format in [RFC 7468](https://tools.ietf.org/html/rfc7468), iykyk). and here's the part people fumble: you can concatenate multiple certificates together in that one string, and the leaf certificate goes first. leaf. first. periodt. π
the crl is allowed to be NULL. OR it can be a C string holding a PEM format certificate revocation list for the associated authority β that's the "these specific certs are cancelled, actually" list π
π§ RETURN VALUES π§
- returns
0when it slays (success) β¨ - returns non-zero otherwise (it did not slay) π
π ERRORS π
NNG_ENOMEMβ there's just not enough memory available. the RAM said "I'm full bestie". πNNG_EBUSYβ the configurationcfgis already in use, so it literally cannot be modified. like, hands off, it's busy being a main character π₯NNG_EINVALβ an invalidchainorcrlwas supplied. you handed it something it can't work with. π
π«Ά SEE ALSO π«Ά
nng_strerror(3)nng_tls_config_alloc(.3tls)nng_tls_config_auth_mode(.3tls)nng_tls_config_ca_file(.3tls)nng(7)
and that's the whole page, bestie π go forth and configure your CA chain, you've got this, it's literally your era ππ
sign-off szn: this iconic little page comes from the NNG Reference Manual, and it's dated 2026-06-30. keep it close, memo it, screenshot it, whatever β just don't lose the date, that's the lore βπ
π¦ 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