libressl-SSL_copy_session_id(3)

libressl-SSL_copy_session_id3

Copy session details between ssl objects

Usage

SSL Library (libssl, -lssl) libcrypto

#include <openssl/ssl.h>

int

SSL_copy_session_id(SSL *to, const SSL *from);

Overview

SSL_copy_session_id() copies the following data from from to to:

  • the pointer to the SSL_SESSION object, incrementing its reference count by 1

  • the pointer to the SSL_METHOD object; if that changes the method, protocol-specific data is reinitialized

  • the pointer to the CERT object, incrementing its reference count by 1

  • the session ID context

This function is used internally by SSL_dup(3) and by BIO_ssl_copy_session_id(3).

Return values

SSL_copy_session_id() returns 1 on success and 0 on error.

History

SSL_copy_session_id() appeared in SSLeay 0.4 or earlier and has been available since OpenBSD 2.4.

Bugs

Failures of CRYPTO_add(3) are silently ignored and may leave to in an invalid or inconsistent state.

From libressl 4.4.0-1 in Arch Linux 2026-11-01. Parsed by carta from the page's mdoc source.