jcs's openbsd hax
openbsd
1.\" $OpenBSD: SSL_set_SSL_CTX.3,v 1.5 2025/06/08 22:52:00 schwarze Exp $
2.\"
3.\" Copyright (c) 2020 Ingo Schwarze <schwarze@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: June 8 2025 $
18.Dt SSL_SET_SSL_CTX 3
19.Os
20.Sh NAME
21.Nm SSL_set_SSL_CTX
22.Nd modify an SSL connection object to use another context
23.Sh SYNOPSIS
24.Lb libssl libcrypto
25.In openssl/ssl.h
26.Ft SSL_CTX *
27.Fo SSL_set_SSL_CTX
28.Fa "SSL *ssl"
29.Fa "SSL_CTX* ctx"
30.Fc
31.Sh DESCRIPTION
32.Fn SSL_set_SSL_CTX
33causes
34.Fa ssl
35to use the context
36.Fa ctx .
37.Pp
38If
39.Fa ctx
40is
41.Dv NULL ,
42.Fa ssl
43reverts to using the context that it was initially created from with
44.Xr SSL_new 3 .
45.Pp
46If
47.Fa ssl
48already uses
49.Fa ctx ,
50no action occurs.
51.Sh RETURN VALUES
52.Fn SSL_set_SSL_CTX
53returns an internal pointer to the context that
54.Fa ssl
55is using as a result of the call, or
56.Dv NULL
57if memory allocation fails.
58.Sh SEE ALSO
59.Xr ssl 3 ,
60.Xr SSL_clear 3 ,
61.Xr SSL_CTX_new 3 ,
62.Xr SSL_get_SSL_CTX 3 ,
63.Xr SSL_new 3 ,
64.Xr SSL_set_security_level 3
65.Sh HISTORY
66.Fn SSL_set_SSL_CTX
67first appeared in OpenSSL 0.9.8f and has been available since
68.Ox 4.5 .