gnutls_x509_crt_set_version(3)
β¨ gnutls_x509_crt_set_version β¨
okay bestie, welcome to the gnutls manual page for gnutls_x509_crt_set_version(3) β yes that's the whole name, it's giving "my parents named me after my job" energy but we move π
πΈ NAME πΈ
gnutls_x509_crt_set_version β literally an API function, that's it, that's the vibe
π SYNOPSIS π
#include <gnutls/x509.h>
int gnutls_x509_crt_set_version(gnutls_x509_crt_t crt, unsigned int version);
look at her. two args, one int coming back, no notes. iconic.
π¦ ARGUMENTS π¦
gnutls_x509_crt_t crtβ bestie this is the certificate, and its type is literallygnutls_x509_crt_t. it is what it is π«Άunsigned int versionβ this one holds the version number. and listen: for X.509v1 certificates it must be1. no wiggle room, no "close enough", just1.
π DESCRIPTION π
so what does this function actually DO. it sets the version of the certificate. that's the whole thing. the number you pass is the version β one for X.509 version 1, and so on, you get the pattern, it's not rocket science π
plain certificates (the ones with no extensions, living their simple unbothered life) must have version set to one. periodt.
β οΈ okay this is the important part, bestie, pay attention: to create well-formed certificates you MUST specify version 3 if you're using any certificate extensions. not 1. not 2. 3. the vibe check is strict here π
and in case you're wondering "wait, who's making these extensions" β they're created by functions like gnutls_x509_crt_set_subject_alt_name() or gnutls_x509_crt_set_key_usage(). so if you're out here calling those and then setting version 1, that's not slay, that's a malformed certificate π
π RETURNS π
on success you get GNUTLS_E_SUCCESS (which is 0, the good number, the green flag π’). otherwise you get a negative error value, which is giving red flag energy, and you should probably go look at what went wrong.
π REPORTING BUGS π
found a bug? no gatekeeping, tell the devs:
- 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. (aka: free to share, 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, go visit:
https://www.gnutls.org/manual/
and that's the whole page bestie, you ate π
this has been gnutls, version 3.8.13, dated with gnutls_x509_crt_set_version(3) β thanks for reading, 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