---
name: "libressl-OPENSSL_VERSION_NUMBER"
section: "3"
platform: "linux"
package: "libressl"
version: "4.4.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/libressl-OPENSSL_VERSION_NUMBER"
---

# libressl-OPENSSL\_VERSION\_NUMBER(3)

get OpenSSL version number

## 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

Crypto Library (libcrypto, -lcrypto)

**#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

OPENSSL\_VERSION\_NUMBER and LIBRESSL\_VERSION\_NUMBER are numeric release version identifiers. The first two digits contain the major release number, the third and fourth digits the minor release number, and the fifth and sixth digits the fix release number. For OpenSSL, the seventh and eight digits contain the patch release number and the final digit is 0 for development, 1 to e for betas 1 to 14, or f for release. For LibreSSL, OPENSSL\_VERSION\_NUMBER is always 0x020000000, and LIBRESSL\_VERSION\_NUMBER always ends with 00f.

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
```

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.

For example:

```
0x000904100 == 0.9.4 release
0x000905000 == 0.9.5 dev
```

OpenSSL version 0.9.5a had an interim interpretation that is like the current one, except the patch level got the highest bit set, to keep continuity. The number was therefore 0x0090581f.

**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\_TEXT is 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

  The OPENSSLDIR setting 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

  The ENGINESDIR setting of the library build in the form "ENGINESDIR: "..."" if available or "ENGINESDIR: N/A" otherwise. LibreSSL never provides or uses an ENGINESDIR.

For an unknown *t*, the text "not available" is returned.

For backward compatibility, SSLEAY\_VERSION\_NUMBER is an alias for OPENSSL\_VERSION\_NUMBER and **SSLeay**() 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.

## RETURN VALUES

**OpenSSL\_version\_num**() and **SSLeay**() return a constant version number.

**OpenSSL\_version**() and **SSLeay\_version**() return pointers to static strings.

## SEE ALSO

[crypto(3)](/crypto/3.md), OPENSSL\_config(3)

## HISTORY

**SSLeay**(), **SSLeay\_version**(), and SSLEAY\_VERSION\_NUMBER first appeared in SSLeay 0.6.0 and have been available since OpenBSD 2.4.

OPENSSL\_VERSION\_NUMBER first appeared in the first OpenSSL release, OpenSSL 0.9.1c, and has been available since OpenBSD 2.6.

SSLEAY\_DIR first appeared in OpenSSL 0.9.7 and have been available since OpenBSD 3.2.

LIBRESSL\_VERSION\_NUMBER first 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\_TEXT first appeared in LibreSSL 2.2.2 and OpenBSD 5.8.

**OpenSSL\_version\_num**() and **OpenSSL\_version**() first appeared in OpenSSL 1.1.0 and have been available since LibreSSL 2.7.1 and OpenBSD 6.3.
