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

# libressl-SSL\_set\_SSL\_CTX(3)

modify an SSL connection object to use another context

## NAME

**SSL\_set\_SSL\_CTX** – modify an SSL connection object to use another context

## SYNOPSIS

SSL Library (libssl, -lssl) libcrypto

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

*SSL\_CTX* *\**\

**SSL\_set\_SSL\_CTX**(*SSL \*ssl*, *SSL\_CTX\* ctx*);

## DESCRIPTION

**SSL\_set\_SSL\_CTX**() causes *ssl* to use the context *ctx*.

If *ctx* is NULL, *ssl* reverts to using the context that it was initially created from with SSL\_new(3).

If *ssl* already uses *ctx*, no action occurs.

## RETURN VALUES

**SSL\_set\_SSL\_CTX**() returns an internal pointer to the context that *ssl* is using as a result of the call, or NULL if memory allocation fails.

## SEE ALSO

[ssl(3)](/ssl/3.md), SSL\_clear(3), SSL\_CTX\_new(3), SSL\_get\_SSL\_CTX(3), SSL\_new(3), SSL\_set\_security\_level(3)

## HISTORY

**SSL\_set\_SSL\_CTX**() first appeared in OpenSSL 0.9.8f and has been available since OpenBSD 4.5.
