NNG_TLS_CONFIG_SERVER_NAME(3tls)

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

πŸŽ€ NAME πŸŽ€

nng_tls_config_server_name β€” bestie, this is the one that sets the remote server name πŸ’–

It lives in the NNG Reference Manual, section 3tls, and yeah it's a manual page, but like... a fun one? Okay let's go ✨


🌸 SYNOPSIS 🌸

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

int nng_tls_config_server_name(nng_tls_config *cfg, const char *name);

✨ DESCRIPTION ✨

okay so here's the tea β˜• β€” nng_tls_config_server_name() configures the remote server name that a client is gonna use when it connects to a server. Like, this is the name the client walks up to the server wearing 🫢

And what does it actually do with that name? Two things, no cap:

  • that name you supply gets used when comparing the identity in the server's certificate πŸ‘‘ (so it's the thing your cert has to match up to)
  • and furthermore, when Server Name Indication (SNI) is in play, that name may be sent over to the server as a hint β€” a little "hey bestie, use this one please" πŸŽ€ β€” telling it which of several possible certificates should be used
πŸ’… Tip: this function is only useful in configuring client behavior. Server-side? Not your moment, babe.

🌈 RETURN VALUES 🌈

Slays when it works: returns 0 on success, and non-zero otherwise. That's it, that's the vibe check πŸ’–


πŸ’€ ERRORS πŸ’€

  • NNG_ENOMEM β€” insufficient memory is available 😭 like the system literally cannot right now
  • NNG_EBUSY β€” the configuration cfg is already in use, and cannot be modified πŸ™ˆ she's busy, she's booked, she's not taking edits rn

πŸ¦‹ SEE ALSO πŸ¦‹


and that's the whole page!! ✨ this came out of the NNG Reference Manual, dated 2026-06-30 πŸ“… β€” with love from the NNG girlies, mwah πŸ«ΆπŸ’–πŸŽ€

πŸ“¦ where this page comes from