]> git.ipfire.org Git - thirdparty/openssl.git/blame - doc/man3/SSL_CTX_add_session.pod
Following the license change, modify the boilerplates in doc/man3/
[thirdparty/openssl.git] / doc / man3 / SSL_CTX_add_session.pod
CommitLineData
0bc6597d
LJ
1=pod
2
3=head1 NAME
4
1722496f 5SSL_CTX_add_session, SSL_CTX_remove_session - manipulate session cache
0bc6597d
LJ
6
7=head1 SYNOPSIS
8
9 #include <openssl/ssl.h>
10
11 int SSL_CTX_add_session(SSL_CTX *ctx, SSL_SESSION *c);
0bc6597d
LJ
12
13 int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c);
0bc6597d
LJ
14
15=head1 DESCRIPTION
16
17SSL_CTX_add_session() adds the session B<c> to the context B<ctx>. The
18reference count for session B<c> is incremented by 1. If a session with
19the same session id already exists, the old session is removed by calling
9b86974e 20L<SSL_SESSION_free(3)>.
0bc6597d 21
b8964668
MC
22SSL_CTX_remove_session() removes the session B<c> from the context B<ctx> and
23marks it as non-resumable. L<SSL_SESSION_free(3)> is called once for B<c>.
0bc6597d 24
0bc6597d
LJ
25=head1 NOTES
26
27When adding a new session to the internal session cache, it is examined
28whether a session with the same session id already exists. In this case
29it is assumed that both sessions are identical. If the same session is
30stored in a different SSL_SESSION object, The old session is
31removed and replaced by the new session. If the session is actually
32identical (the SSL_SESSION object is identical), SSL_CTX_add_session()
33is a no-op, and the return value is 0.
34
e0db2eed
GT
35If a server SSL_CTX is configured with the SSL_SESS_CACHE_NO_INTERNAL_STORE
36flag then the internal cache will not be populated automatically by new
37sessions negotiated by the SSL/TLS implementation, even though the internal
38cache will be searched automatically for session-resume requests (the
fc1d88f0 39latter can be suppressed by SSL_SESS_CACHE_NO_INTERNAL_LOOKUP). So the
e0db2eed
GT
40application can use SSL_CTX_add_session() directly to have full control
41over the sessions that can be resumed if desired.
42
0bc6597d
LJ
43
44=head1 RETURN VALUES
45
46The following values are returned by all functions:
47
48=over 4
49
c8919dde 50=item Z<>0
0bc6597d 51
32c57705
BB
52The operation failed. In case of the add operation, it was tried to add
53the same (identical) session twice. In case of the remove operation, the
54session was not found in the cache.
0bc6597d 55
c8919dde 56=item Z<>1
1bc74519 57
32c57705 58The operation succeeded.
0bc6597d
LJ
59
60=back
61
62=head1 SEE ALSO
63
b97fdb57 64L<ssl(7)>,
9b86974e
RS
65L<SSL_CTX_set_session_cache_mode(3)>,
66L<SSL_SESSION_free(3)>
0bc6597d 67
e2f92610
RS
68=head1 COPYRIGHT
69
70Copyright 2001-2016 The OpenSSL Project Authors. All Rights Reserved.
71
4746f25a 72Licensed under the Apache License 2.0 (the "License"). You may not use
e2f92610
RS
73this file except in compliance with the License. You can obtain a copy
74in the file LICENSE in the source distribution or at
75L<https://www.openssl.org/source/license.html>.
76
77=cut