gnutls_x509_crt_check_hostname(3)
π gnutls_x509_crt_check_hostname π
okay bestie, so this one lives in the gnutls manual, and it's literally the vibe check for certificates. like, does this cert actually belong to this hostname or is it lying to you? that's the whole thing. let's get into it π¦
β¨ NAME β¨
gnutls_x509_crt_check_hostname β API function
πΈ SYNOPSIS πΈ
#include <gnutls/x509.h>
unsigned gnutls_x509_crt_check_hostname(gnutls_x509_crt_t cert, const
char * hostname);
π ARGUMENTS π
gnutls_x509_crt_t certβ bestie this should contain angnutls_x509_crt_ttype. like that's the cert you're interrogating πconst char * hostnameβ a null terminated string that contains a DNS name. so the name you're checking against, no cap.
π DESCRIPTION π
so here's the tea: this function will check if the given certificate's subject matches the given hostname. that's it, that's the job π«Ά
it's a basic implementation of the matching described in RFC6125, and it takes into account wildcards, and the DNSName/IPAddress subject alternative name PKIX extension. so yes, wildcards are handled, and yes, the SAN extension is very much in the room with us π
for details see also gnutls_x509_crt_check_hostname2(). iykyk β¨
β RETURNS β
non-zero for a successful match, and zero on failure. so likeβ¦ truthy = slay, falsy = not slay π
π REPORTING BUGS π
Report bugs to <bugs@gnutls.org>. Home page: https://www.gnutls.org
if something's broken, tell the gnutls girlies directly, don't suffer in silence π
π 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.
π 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/
okay that's the whole page, no notes. this is from gnutls 3.8.13, and it was serving gnutls_x509_crt_check_hostname(3) realness the entire time. go check those hostnames, bestie, and stay iconic ππβ¨
π¦ 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