gnutls_certificate_type_get2(3)
β¨ gnutls_certificate_type_get2 β¨
okay bestie, welcome to the gnutls manual page for gnutls_certificate_type_get2(3) β yes it's a whole function and yes it's iconic π
let's get into it
π¦ SYNOPSIS π¦
#include <gnutls/gnutls.h>
gnutls_certificate_type_t gnutls_certificate_type_get2(gnutls_session_t
session, gnutls_ctype_target_t target);
like. look at her. she's serving signature π
πΈ ARGUMENTS πΈ
gnutls_session_t sessionβ bestie this is agnutls_session_ttype. that's the whole vibe. it's your session π«Άgnutls_ctype_target_t targetβ and this one is agnutls_ctype_target_ttype. mhm. exactly what it says on the tin β¨
π DESCRIPTION π
so what does she do. she returns the type of certificate that a side is negotiated to use. periodt π
by default the certificate type is X.509 β that's the default, no cap β unless an alternative certificate type got enabled by gnutls_init() and then negotiated during the session. so like, only if someone actually turned that on π
now the target parameter? she's the one who decides whose negotiated certificate type you're asking about:
GNUTLS_CTYPE_CLIENTβ gimme the negotiated cert type for the client πGNUTLS_CTYPE_SERVERβ gimme the negotiated cert type for the server π
and then, plot twist, in P2P mode connection setups where you genuinely don't know in advance who's gonna be the client and who's gonna be the server (main character chaos energy honestly π), you can use these flags instead:
GNUTLS_CTYPE_OURSβ retrieves the corresponding cert type for us πGNUTLS_CTYPE_PEERSβ retrieves the corresponding cert type for our peers π§
also important bestie: resumed sessions will return the certificate type that was negotiated and used in the original session. the original one. not a new one. so that means this function can be used to reliably determine the type of the certificate returned by gnutls_certificate_get_peers(). slay π₯ that's genuinely useful, fr fr.
β RETURNS β
the currently used gnutls_certificate_type_t certificate type β for the client or the server, depending on what you asked for. simple as π
π°οΈ SINCE π°οΈ
3.6.4 β she's been here a minute, she's a seasoned queen π
π REPORTING BUGS π
found a bug? not me gatekeeping β report it, please and thank you π
- Report bugs to <bugs@gnutls.org>.
- Home page: https://www.gnutls.org
Β©οΈ 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.
(so like. keep the notice. that's the rule. respect the queen's paperwork π )
π 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, go visit:
https://www.gnutls.org/manual/
iykyk β¨
lowkey a reminder: the descriptions above are the whole truth and nothing but β don't go assuming extra behaviour, bestie, the manpage said what it said πΈ
and that's the page!! this lil beauty lives in the gnutls manual, version 3.8.13, dated alongside gnutls_certificate_type_get2(3) π go forth and negotiate your certificate types responsibly, 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