NNG_HTTP_SERVER_GET_TLS(3http)

πŸ“¦ version 1.11, in alpine 3.24

πŸ’… 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 πŸ‘‘

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