OPENSSL_VERSION_NUMBER(3)
π OPENSSL_VERSION_NUMBER(3) β Library Functions Manual
okay so bestie, welcome to the manual page where we figure out which version of OpenSSL / LibreSSL you're actually running. it's giving "who am i" but for a crypto library. no cap, this one's important. π
β¨ NAME β¨
OPENSSL_VERSION_NUMBER, LIBRESSL_VERSION_NUMBER, LIBRESSL_VERSION_TEXT, OPENSSL_VERSION_TEXT, OpenSSL_version_num, OpenSSL_version, SSLeay, SSLeay_version β get OpenSSL version number πΈ
π¦ SYNOPSIS π¦
library "libcrypto"
#include <openssl/opensslv.h>
#define OPENSSL_VERSION_NUMBER 0x020000000L
#define LIBRESSL_VERSION_NUMBER 0x02nnnn00fL
#define LIBRESSL_VERSION_TEXT "LibreSSL 2.n.n"
#define OPENSSL_VERSION_TEXT LIBRESSL_VERSION_TEXT
#include <openssl/crypto.h>
unsigned long
OpenSSL_version_num(void);
const char *
OpenSSL_version(int t);
long
SSLeay(void);
const char *
SSLeay_version(int t);
π DESCRIPTION π
so OPENSSL_VERSION_NUMBER and LIBRESSL_VERSION_NUMBER are these numeric release version identifiers β literally a number that is the version. here's the tea on how they're laid out:
- the first two digits = the major release number
- the third and fourth digits = the minor release number
- the fifth and sixth digits = the fix release number
for OpenSSL:
- the seventh and eighth digits = the patch release number
- the final digit is
0for development,1toefor betas 1 to 14, orffor release π
for LibreSSL:
OPENSSL_VERSION_NUMBERis always0x020000000LIBRESSL_VERSION_NUMBERalways ends with00fπ
for example:
OPENSSL_VERSION_NUMBER:
0x000906000 == 0.9.6 dev
0x000906023 == 0.9.6b beta 3
0x00090605f == 0.9.6e release
0x020000000 == 2.0.0 for any version of LibreSSL
LIBRESSL_VERSION_NUMBER:
0x02070000f == LibreSSL 2.7.0
and like, history lesson time π«Ά β OpenSSL versions prior to 0.9.3 had identifiers < 0x0930. for versions between 0.9.3 and 0.9.5, the seventh digit was 1 for release and 0 otherwise, and the eighth and ninth digits were the patch release number. iconic but confusing, i know. π
for example:
0x000904100 == 0.9.4 release
0x000905000 == 0.9.5 dev
and OpenSSL version 0.9.5a had this interim interpretation that's like the current one, except the patch level got the highest bit set, to keep continuity. so the number was therefore 0x0090581f. weird little flex but ok π
OpenSSL_version_num() returns OPENSSL_VERSION_NUMBER.
OpenSSL_version() returns different strings depending on t:
OPENSSL_VERSIONβ the text variant of the version number,OPENSSL_VERSION_TEXT. for OpenSSL it includes the release date, for example"OpenSSL 0.9.5a 1 Apr 2000". for LibreSSL,LIBRESSL_VERSION_TEXTis returned. β¨OPENSSL_CFLAGSβ the compiler flags set for the compilation process, in the form"compiler: ..."if available, or"compiler: information not available"otherwise. LibreSSL never provides compiler information. πOPENSSL_BUILT_ONβ the date of the build process, in the form"built on: ..."if available, or"built on: date not available"otherwise. LibreSSL never provides information on the build date.OPENSSL_PLATFORMβ the Configure target of the library build, in the form"platform: ..."if available, or"platform: information not available"otherwise. LibreSSL never provides platform information.OPENSSL_DIRβ theOPENSSLDIRsetting of the library build, in the form"OPENSSLDIR: "...""if available, or"OPENSSLDIR: N/A"otherwise. for LibreSSL, the default is"OPENSSLDIR: "/etc/ssl"". πOPENSSL_ENGINES_DIRβ theENGINESDIRsetting of the library build, in the form"ENGINESDIR: "...""if available, or"ENGINESDIR: N/A"otherwise. LibreSSL never provides or uses anENGINESDIR.
for an unknown t, the text "not available" is returned. rude but fair.
for backward compatibility, SSLEAY_VERSION_NUMBER is an alias for OPENSSL_VERSION_NUMBER, and SSLeay() is an alias for OpenSSL_version_num(). the legacy function SSLeay_version() is similar to OpenSSL_version() except that it takes arguments SSLEAY_VERSION, SSLEAY_CFLAGS, SSLEAY_BUILT_ON, SSLEAY_PLATFORM, and SSLEAY_DIR β which expand to other numerical values than the corresponding OPENSSL_* macros. so don't mix them up bestie, i'm warning you π«Ά
ok lowkey important:SSLeay_version()uses a whole different set of numeric constants thanOpenSSL_version(). same vibes, different numbers. keep that straight.
π₯ RETURN VALUES π₯
OpenSSL_version_num()andSSLeay()return a constant version number.OpenSSL_version()andSSLeay_version()return pointers to static strings.
π SEE ALSO π
π HISTORY π
SSLeay(),SSLeay_version(), andSSLEAY_VERSION_NUMBERfirst appeared in SSLeay 0.6.0 and have been available since OpenBSD 2.4. βOPENSSL_VERSION_NUMBERfirst appeared in the first OpenSSL release, OpenSSL 0.9.1c, and has been available since OpenBSD 2.6.SSLEAY_DIRfirst appeared in OpenSSL 0.9.7 and have been available since OpenBSD 3.2.LIBRESSL_VERSION_NUMBERfirst appeared in LibreSSL 2.0.0 and OpenBSD 5.6, and got its final format in LibreSSL 2.3.2 and OpenBSD 5.9.LIBRESSL_VERSION_TEXTfirst appeared in LibreSSL 2.2.2 and OpenBSD 5.8.OpenSSL_version_num()andOpenSSL_version()first appeared in OpenSSL 1.1.0 and have been available since LibreSSL 2.7.1 and OpenBSD 6.3. π
and that's the whole page, bestie! π§ this lil drop is from Debian, dated June 8, 2025 β so if anyone asks, that's the source and the date, periodt. π β¨
π¦ where this page comes from
- alpine 3.24: libressl-doc 4.3.1-r0 Β· custom
- arch rolling: libressl 4.4.0-1 Β· ISC AND custom:OpenSSL
- Copyright (c) 2017, 2018 Ingo Schwarze <schwarze@openbsd.org>
- Copyright (c) 2000, 2002, 2015, 2016, 2017 The OpenSSL Project
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms