gnutls_certificate_get_ours(3)
π gnutls_certificate_get_ours(3) π
okay bestie, so this one lives in the gnutls manual (you know, the TLS library that's literally carrying the whole internet on its back π ) and it's all about grabbing your own certificate back out of a session. let's get into it π«Ά
β¨ SYNOPSIS β¨
#include <gnutls/gnutls.h>
const gnutls_datum_t * gnutls_certificate_get_ours(gnutls_session_t
session);
like, one function, one argument, one pointer. clean. iconic. no notes. π
π ARGUMENTS π
gnutls_session_t sessionβ bestie this is just a gnutls session. that's the whole vibe. hand it your session and it'll do the thing.
πΈ DESCRIPTION πΈ
so the tea is: this function gets the certificate as sent to the peer in the last handshake. π€
and it comes back in raw (DER) format, which β ngl β is giving "not human readable, don't even try to read it with your eyes". π§
also important: no certificate list is being returned. Only the first certificate. that's it. that's the whole drop. no chain, no extras, just the first one. π
here's the part you actually need to remember though, and it's lowkey a plot twist: this function returns the certificate that was sent in the current handshake. in subsequent resumed sessions, this function will return NULL. π
and yeah, that differs from gnutls_certificate_get_peers(), which always returns the peer's certificate used in the original session. so they are not the same, bestie, don't mix them up, i'm begging π
β RETURNS β
a pointer to a gnutls_datum_t containing our certificate, or NULL in case of an error or if no certificate was used. that's the whole returns situation. if you get NULL, it's not a vibe, but it's also not a mystery. π
π¦ REPORTING BUGS π¦
found a bug? don't suffer in silence, tell the people:
- 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, go off, just keep the receipts. 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/
not me ending this by saying: if your resumed session hands you NULL, that's not a bug, that's just the documented behaviour, bestie. don't @ me. π
mwah π that was the gnutls manual, version 3.8.13, page gnutls_certificate_get_ours(3). go read the cert, you icon. πβ¨
π¦ 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