NNG_HTTP_SERVER_GET_TLS(3http)
π nng_http_server_get_tls β get HTTP server TLS configuration π
okay bestie, welcome to the nng_http_server_get_tls(3http) page from the NNG Reference Manual β¨ β yes that's the manual name, we're fancy here. the way this one's a little one-function baddie that just... hands you the TLS config. iconic.
πΈ SYNOPSIS πΈ
#include <nng/nng.h>
#include <nng/supplemental/http/http.h>
int nng_http_server_get_tls(nng_http_server *s, nng_tls_config **cfgp);
literally just two includes and one function call. we love a low-effort slay π«Ά
β¨ DESCRIPTION β¨
nng_http_server_get_tls() grabs the TLS configuration off server s and saves a pointer to it right into the address that cfgp points at. that's it. that's the whole vibe check. π
okay so this is the important part, don't skip it π β the object comes back with an extra hold on it (peep nng_tls_config_hold(), that's the mechanism), placed there on behalf of you, the caller. so you're holding a reference now. when you're done with the TLS configuration, the caller should free that hold by calling nng_tls_config_free(). no leaving it hanging, no cap, take care of your refs π§β¨
π₯ RETURN VALUES π₯
returns 0 on success, and non-zero otherwise. that's the whole story bestie π
π¦ ERRORS π¦
NNG_EINVALβ TLS is not configured on the server. like, there's nothing there to get. πNNG_ENOMEMβ insufficient free memory exists. the machine is going through it rn.NNG_ENOTSUPβ either HTTP or TLS isn't supported. this build said "not today." π
π SEE ALSO π
nng_http_server_hold(3http)nng_http_server_set_tls(3http)nng_http_server_start(3http)nng_tls_config_alloc(3tls)nng_tls_config_free(3tls)nng_tls_config_hold(3tls)nng_strerror(3)nng(7)
go read the whole friend group, they all link up π«Άβ¨
and that's the page, periodt π this was the nng_http_server_get_tls(3http) entry from the NNG Reference Manual, dated 2026-01-13 β mwah, go touch some TLS configs responsibly, ily, bye ππβ
π¦ where this page comes from
- alpine 3.24: nng-doc 1.11-r0 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms