1SSL_NEW(3)                          OpenSSL                         SSL_NEW(3)
2
3
4

NAME

6       SSL_dup, SSL_new, SSL_up_ref - create an SSL structure for a connection
7

SYNOPSIS

9        #include <openssl/ssl.h>
10
11        SSL *SSL_dup(SSL *s);
12        SSL *SSL_new(SSL_CTX *ctx);
13        int SSL_up_ref(SSL *s);
14

DESCRIPTION

16       SSL_new() creates a new SSL structure which is needed to hold the data
17       for a TLS/SSL connection. The new structure inherits the settings of
18       the underlying context ctx: connection method, options, verification
19       settings, timeout settings. An SSL structure is reference counted.
20       Creating an SSL structure for the first time increments the reference
21       count. Freeing it (using SSL_free) decrements it. When the reference
22       count drops to zero, any memory or resources allocated to the SSL
23       structure are freed.
24
25       SSL_up_ref() increments the reference count for an existing SSL
26       structure.
27
28       SSL_dup() duplicates an existing SSL structure into a new allocated
29       one. All settings are inherited from the original SSL structure.
30       Dynamic data (i.e.  existing connection details) are not copied, the
31       new SSL is set into an initial accept (server) or connect (client)
32       state.
33

RETURN VALUES

35       The following return values can occur:
36
37       NULL
38           The creation of a new SSL structure failed. Check the error stack
39           to find out the reason.
40
41       Pointer to an SSL structure
42           The return value points to an allocated SSL structure.
43
44           SSL_up_ref() returns 1 for success and 0 for failure.
45

SEE ALSO

47       SSL_free(3), SSL_clear(3), SSL_CTX_set_options(3), SSL_get_SSL_CTX(3),
48       ssl(7)
49
51       Copyright 2000-2017 The OpenSSL Project Authors. All Rights Reserved.
52
53       Licensed under the OpenSSL license (the "License").  You may not use
54       this file except in compliance with the License.  You can obtain a copy
55       in the file LICENSE in the source distribution or at
56       <https://www.openssl.org/source/license.html>.
57
58
59
601.1.1d                            2019-10-03                        SSL_NEW(3)
Impressum