gnutls_alpn_set_protocols(3)

✨ gnutls_alpn_set_protocols ✨

okay bestie, so this is a page straight out of the gnutls manual β€” like, the actual gnutls_alpn_set_protocols(3) one πŸ’– β€” and I'm gonna walk you through it like we're texting at 2am.


🌸 NAME 🌸

gnutls_alpn_set_protocols β€” it's an API function, no cap 🫢


🌈 SYNOPSIS 🌈

#include <gnutls/gnutls.h>

int gnutls_alpn_set_protocols(gnutls_session_t session, const
       gnutls_datum_t * protocols, unsigned protocols_size, unsigned int
       flags);

πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_session_t session β€” it's a gnutls_session_t type. that's the whole vibe of this one, she's just here being herself ✨
  • const gnutls_datum_t * protocols β€” these are the protocol names you're adding. the cast πŸ’…
  • unsigned protocols_size β€” the number of protocols you're adding. yes bestie, you gotta count them, she doesn't guess πŸ”₯
  • unsigned int flags β€” zero, or a sequence of gnutls_alpn_flags_t. zero is always an option and that's iconic of her πŸ‘‘

πŸ’œ DESCRIPTION πŸ’œ

so this function? both clients and servers use it, okay β€” it's giving equal opportunity. you call it to declare the supported ALPN protocols, and those are the ones that get used during negotiation with the peer. that's literally the whole job πŸ¦‹

for the documentation of the available flags, go look at the gnutls_alpn_flags_t description. she explains herself there, iykyk ✨


⭐ RETURNS ⭐

  • if it works: GNUTLS_E_SUCCESS (0) comes back to you πŸŽ‰
  • if it doesn't: you get a negative error code. not me getting a negative error code 😭
Since 3.2.0 β€” she's been here a minute, an OG fr fr πŸ’…

πŸ› REPORTING BUGS πŸ›

found something cursed? report bugs to <bugs@gnutls.org>. 🫢

home page: https://www.gnutls.org


Copyright Β© 2001-2023 Free Software Foundation, Inc., and others.

copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. like, go off, just keep the receipts 🧚


πŸ”₯ SEE ALSO πŸ”₯

the full documentation for gnutls is maintained as a Texinfo manual. if the /usr/share/doc/gnutls/ directory does not contain the HTML form, visit:

https://www.gnutls.org/manual/


and that's the page, bestie β€” no notes, she ate πŸ’–

this whole thing lives in the gnutls 3.8.13 manual set under the name gnutls_alpn_set_protocols(3), and yeah the footer in the original is just the version stamp β€” so consider this your cute little sign-off: gnutls, 3.8.13, periodt βœ¨πŸŒΈπŸ’…

πŸ“¦ where this page comes from