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

# libressl-SSL\_copy\_session\_id(3)

copy session details between SSL objects

## NAME

**SSL\_copy\_session\_id** – copy session details between SSL objects

## SYNOPSIS

SSL Library (libssl, -lssl) libcrypto

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

*int*\

**SSL\_copy\_session\_id**(*SSL \*to*, *const SSL \*from*);

## DESCRIPTION

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

## SEE ALSO

BIO\_ssl\_copy\_session\_id(3), [ssl(3)](/ssl/3.md), SSL\_dup(3), SSL\_get\_session(3), SSL\_SESSION\_get\_id(3), SSL\_SESSION\_new(3), SSL\_set\_session(3), SSL\_set\_session\_id\_context(3)

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