1.\" $OpenBSD: SSL_set_SSL_CTX.3,v 1.3 2020/09/22 13:27:08 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: September 22 2020 $ 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.In openssl/ssl.h 25.Ft SSL_CTX * 26.Fo SSL_set_SSL_CTX 27.Fa "SSL *ssl" 28.Fa "SSL_CTX* ctx" 29.Fc 30.Sh DESCRIPTION 31.Fn SSL_set_SSL_CTX 32causes 33.Fa ssl 34to use the context 35.Fa ctx . 36.Pp 37If 38.Fa ctx 39is 40.Dv NULL , 41.Fa ssl 42reverts to using the context that it was initially created from with 43.Xr SSL_new 3 . 44.Pp 45If 46.Fa ssl 47already uses 48.Fa ctx , 49no action occurs. 50.Sh RETURN VALUES 51.Fn SSL_set_SSL_CTX 52returns an internal pointer to the context that 53.Fa ssl 54is using as a result of the call, or 55.Dv NULL 56if memory allocation fails. 57.Sh SEE ALSO 58.Xr ssl 3 , 59.Xr SSL_clear 3 , 60.Xr SSL_CTX_new 3 , 61.Xr SSL_get_SSL_CTX 3 , 62.Xr SSL_new 3 63.Sh HISTORY 64.Fn SSL_set_SSL_CTX 65first appeared in OpenSSL 0.9.8f and has been available since 66.Ox 4.5 . 67