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

# libressl-SSL\_dup(3)

deep copy of an SSL object

## NAME

**SSL\_dup** – deep copy of an SSL object

## SYNOPSIS

SSL Library (libssl, -lssl) libcrypto

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

*SSL* *\**\

**SSL\_dup**(*SSL \*ssl*);

## DESCRIPTION

**SSL\_dup**() constructs a new *SSL* object in the same context as *ssl* and copies much of the contained data from *ssl* to the new *SSL* object, but many fields, for example tlsext data, are not copied.

As an exception from deep copying, if a session is already established, the new object shares *ssl-\>cert* with the original object.

## RETURN VALUES

**SSL\_dup**() returns the new *SSL* object or NULL on failure.

## SEE ALSO

[ssl(3)](/ssl/3.md), SSL\_clear(3), SSL\_copy\_session\_id(3), SSL\_free(3), SSL\_new(3), SSL\_set\_security\_level(3)

## HISTORY

**SSL\_dup**() first appeared in SSLeay 0.8.0 and has been available since OpenBSD 2.4.
