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

# libressl-SSL\_SESSION\_get0\_cipher(3)

retrieve the SSL cipher associated with a session

## NAME

**SSL\_SESSION\_get0\_cipher** – retrieve the SSL cipher associated with a session

## SYNOPSIS

SSL Library (libssl, -lssl) libcrypto

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

*const* *SSL\_CIPHER* *\**\

**SSL\_SESSION\_get0\_cipher**(*const SSL\_SESSION \*session*);

## DESCRIPTION

**SSL\_SESSION\_get0\_cipher**() retrieves the cipher that was used by the connection when the session was created, or NULL if it cannot be determined.

The value returned is a pointer to an object maintained within *session* and should not be released.

## RETURN VALUES

**SSL\_SESSION\_get0\_cipher**() returns the *SSL\_CIPHER* associated with *session* or NULL if it cannot be determined.

## SEE ALSO

[ssl(3)](/ssl/3.md), SSL\_CIPHER\_get\_name(3), SSL\_get\_current\_cipher(3), SSL\_get\_session(3), SSL\_SESSION\_new(3)

## HISTORY

The **SSL\_SESSION\_get0\_cipher**() function first appeared in OpenSSL 1.1.0 and has been available since OpenBSD 7.0.
