1.\" $OpenBSD: SSL_dup.3,v 1.4 2019/06/12 09:36:30 schwarze Exp $ 2.\" 3.\" Copyright (c) 2016 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 12 2019 $ 18.Dt SSL_DUP 3 19.Os 20.Sh NAME 21.Nm SSL_dup 22.Nd deep copy of an SSL object 23.Sh SYNOPSIS 24.In openssl/ssl.h 25.Ft SSL * 26.Fo SSL_dup 27.Fa "SSL *ssl" 28.Fc 29.Sh DESCRIPTION 30.Fn SSL_dup 31constructs a new 32.Vt SSL 33object in the same context as 34.Fa ssl 35and copies much of the contained data from 36.Fa ssl 37to the new 38.Vt SSL 39object, but many fields, for example tlsext data, are not copied. 40.Pp 41As an exception from deep copying, if a session is already established, 42the new object shares 43.Fa ssl->cert 44with the original object. 45.Sh RETURN VALUES 46.Fn SSL_dup 47returns the new 48.Vt SSL 49object or 50.Dv NULL 51on failure. 52.Sh SEE ALSO 53.Xr ssl 3 , 54.Xr SSL_clear 3 , 55.Xr SSL_copy_session_id 3 , 56.Xr SSL_free 3 , 57.Xr SSL_new 3 58.Sh HISTORY 59.Fn SSL_dup 60first appeared in SSLeay 0.8.0 and has been available since 61.Ox 2.4 . 62