gnutls_compres...ate_set_methods(3)
π gnutls_compress_certificate_set_methods π
okay bestie, so this one is an API function from the gnutls manual (yes, the same gnutls your whole TLS life depends on, no biggie), and it's literally about certificate compression β the glow-up your handshake deserves. let's get into it π
β¨ SYNOPSIS β¨
#include <gnutls/gnutls.h>
int gnutls_compress_certificate_set_methods(gnutls_session_t session,
const gnutls_compression_method_t * methods, size_t methods_len);
like, that's the whole vibe. three args, one int back, iconic.
πΈ ARGUMENTS πΈ
gnutls_session_t sessionβ bestie, this is just agnutls_session_ttype. your session. your main character. β¨const gnutls_compression_method_t * methodsβ a whole list of supported compression methods, like a little roster of faves.size_t methods_lenβ how many compression methods are chillin' inmethods. count them. don't lie about the count. π
π¦ DESCRIPTION π¦
So what does this function actually do? It sets the supported compression methods for certificate compression for the given session. That's the whole job. And that list gets used for two things:
- a) requesting the compression of the peer's certificate
- b) selecting the method to compress the local certificate before sending it over to the peer
And the order matters, bestie β the method that shows up earlier in the list gets preferred over the later ones. first come, first slay. π
But lowkey, even if you set the list of supported compression methods, compression might just... not happen. Because if the peer doesn't support any of your chosen compression methods, it's not used. the peer has to match your energy, fr fr. π
Now here's the part where you have to pay attention, because the list of supported compression methods must meet these criteria:
- Argument
methodsmust be an array of valid compression methods of typegnutls_compression_method_t. - Argument
methods_lenmust contain the number of compression methods stored in themethodsarray, and must be within range <1, 127>.
Those length constraints are defined by the MIN_COMPRESS_CERTIFICATE_METHODS and MAX_COMPRESS_CERTIFICATE_METHODS macros, which are located in the header file compress_certificate.h. so if you're out here guessing numbers, go read the header instead. π
And if eithermethodsormethods_lenis equal to 0, the current list of supported compression methods will be unset. poof. gone. un-set. π
β RETURNS β
GNUTLS_E_SUCCESSon success π- otherwise a negative error code (booo, but at least it's honest)
Since 3.7.4 β she's been around a minute, she's established. π
π REPORTING BUGS π
Found a bug? Don't be shy, tell the devs:
- Report bugs to <bugs@gnutls.org>.
- Home page: https://www.gnutls.org
they want to know. literally.
π COPYRIGHT π
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. (translation: share it, remix it, just keep the receipts. that's the rule. periodt.)
π§ 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 whole page, bestie π«Ά β brought to you by gnutls 3.8.13, aka the version tag that lives at the very bottom of the original manpage, which we are now respectfully honoring with this little sign-off. mwah. π β¨
π¦ where this page comes from
- alpine 3.22: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.23: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.24: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- arch rolling: gnutls 3.8.13-3 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- ubuntu stonking: gnutls-doc 3.8.13-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms