xref: /freebsd/crypto/openssl/doc/man3/SSL_CTX_free.pod (revision 7fdf597e96a02165cfe22ff357b857d5fa15ed8a)
1=pod
2
3=head1 NAME
4
5SSL_CTX_free - free an allocated SSL_CTX object
6
7=head1 SYNOPSIS
8
9 #include <openssl/ssl.h>
10
11 void SSL_CTX_free(SSL_CTX *ctx);
12
13=head1 DESCRIPTION
14
15SSL_CTX_free() decrements the reference count of B<ctx>, and removes the
16SSL_CTX object pointed to by B<ctx> and frees up the allocated memory if the reference count has reached 0.
17
18It also calls the free()ing procedures for indirectly affected items, if
19applicable: the session cache, the list of ciphers, the list of Client CAs,
20the certificates and keys.
21
22If B<ctx> is NULL nothing is done.
23
24=head1 WARNINGS
25
26If a session-remove callback is set (SSL_CTX_sess_set_remove_cb()), this
27callback will be called for each session being freed from B<ctx>'s
28session cache. This implies, that all corresponding sessions from an
29external session cache are removed as well. If this is not desired, the user
30should explicitly unset the callback by calling
31SSL_CTX_sess_set_remove_cb(B<ctx>, NULL) prior to calling SSL_CTX_free().
32
33=head1 RETURN VALUES
34
35SSL_CTX_free() does not provide diagnostic information.
36
37=head1 SEE ALSO
38
39L<SSL_CTX_new(3)>, L<ssl(7)>,
40L<SSL_CTX_sess_set_get_cb(3)>
41
42=head1 COPYRIGHT
43
44Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
45
46Licensed under the Apache License 2.0 (the "License").  You may not use
47this file except in compliance with the License.  You can obtain a copy
48in the file LICENSE in the source distribution or at
49L<https://www.openssl.org/source/license.html>.
50
51=cut
52