---
name: "libressl-OPENSSL_init_crypto"
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_init_crypto"
---

# libressl-OPENSSL\_init\_crypto(3)

initialise and shut down the crypto library

## NAME

**OPENSSL\_init\_crypto**, **OPENSSL\_init**, **OPENSSL\_cleanup** – initialise and shut down the crypto library

## SYNOPSIS

Crypto Library (libcrypto, -lcrypto)

**#include \<openssl/crypto.h\>**

*int*\

**OPENSSL\_init\_crypto**(*uint64\_t options*, *const void \*dummy*);

*void*\

**OPENSSL\_init**(*void*);

*void*\

**OPENSSL\_cleanup**(*void*);

## DESCRIPTION

**OPENSSL\_init\_crypto**() and **OPENSSL\_init**() are deprecated. It is never useful for an application program to call either of them explicitly.

The library automatically calls **OPENSSL\_init\_crypto**() internally with an *options* argument of 0 whenever needed. It is safest to assume that any function may do so.

To enable or disable the standard configuration file, instead use OPENSSL\_config(3) or OPENSSL\_no\_config(3), respectively. To load a non-standard configuration file, refer to CONF\_modules\_load\_file(3).

If **OPENSSL\_init\_crypto**() is called before any other crypto or ssl functions, the crypto library is initialised by allocating various internal resources, in particular calling ERR\_load\_crypto\_strings(3).

The following *options* are supported:

- OPENSSL\_INIT\_LOAD\_CONFIG

  At the end of the initialization, call OPENSSL\_config(3) with a NULL argument, loading the default configuration file.

- OPENSSL\_INIT\_NO\_LOAD\_CONFIG

  Ignore any later calls to OPENSSL\_config(3).

The other *options* flags defined by OpenSSL are all ignored by LibreSSL. The *dummy* argument has no effect.

If this function is called more than once, none of the calls except the first one have any effect.

**OPENSSL\_init**() has no effect at all.

**OPENSSL\_cleanup**() frees process-wide resources allocated by libcrypto. It is intended exclusively for the final shutdown of libcrypto in a process. Before calling it, the application has to ensure that all other threads that may use libcrypto have stopped and that no library component will use libcrypto again. After it returns, libcrypto cannot be reinitialized and no libcrypto or libssl function may be called.

**OPENSSL\_cleanup**() is not a replacement for deprecated cleanup functions such as CRYPTO\_cleanup\_all\_ex\_data(3) and must not be called after individual cryptographic operations or when an individual library component is finished with libcrypto.

## RETURN VALUES

**OPENSSL\_init\_crypto**() is intended to return 1 on success or 0 on error.

## SEE ALSO

CONF\_modules\_load\_file(3), OPENSSL\_config(3), [openssl.cnf(5)](/openssl.cnf/5.md)

## HISTORY

**OPENSSL\_init**() first appeared in OpenSSL 1.0.0e and has been available since OpenBSD 5.3. It stopped having any effect in OpenSSL 1.1.1 and in OpenBSD 5.6.

**OPENSSL\_init\_crypto**() first appeared in OpenSSL 1.1.0 and has been available since OpenBSD 6.3.

**OPENSSL\_cleanup**() first appeared in OpenSSL 1.1.0 and has been available since OpenBSD 7.2.

## BUGS

**OPENSSL\_init\_crypto**() silently ignores almost all kinds of errors. In particular, if memory allocation fails, initialisation is likely to remain incomplete, the library may be in an inconsistent internal state, but the return value will usually indicate success anyway. There is no way for the application program to find out whether library initialisation is actually complete, nor to get back to a consistent state if it isn't.
