Debian Codegraph @

upstream/debian-unstable/man3/SSL_CTX_set_num_tickets.3ssl

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\" ========================================================================
56 .\"
57 .IX Title "SSL_CTX_SET_NUM_TICKETS 3SSL"
58 .TH SSL_CTX_SET_NUM_TICKETS 3SSL 2026-04-07 3.6.2 OpenSSL
59 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
60 .\" way too many mistakes in technical documents.
61 .if n .ad l
62 .nh
63 .SH NAME
64 SSL_set_num_tickets,
65 SSL_get_num_tickets,
66 SSL_CTX_set_num_tickets,
67 SSL_CTX_get_num_tickets,
68 SSL_new_session_ticket
69 \&\- control the number of TLSv1.3 session tickets that are issued
70 .SH SYNOPSIS
71 .IX Header "SYNOPSIS"
72 .Vb 1
73 \& #include <openssl/ssl.h>
74 \&
75 \& int SSL_set_num_tickets(SSL *s, size_t num_tickets);
76 \& size_t SSL_get_num_tickets(const SSL *s);
77 \& int SSL_CTX_set_num_tickets(SSL_CTX *ctx, size_t num_tickets);
78 \& size_t SSL_CTX_get_num_tickets(const SSL_CTX *ctx);
79 \& int SSL_new_session_ticket(SSL *s);
80 .Ve
81 .SH DESCRIPTION
82 .IX Header "DESCRIPTION"
83 \&\fBSSL_CTX_set_num_tickets()\fR and \fBSSL_set_num_tickets()\fR can be called for a server
84 application and set the number of TLSv1.3 session tickets that will be sent to
85 the client after a full handshake. Set the desired value (which could be 0) in
86 the \fBnum_tickets\fR argument. Typically these functions should be called before
87 the start of the handshake.
88 .PP
89 The default number of tickets is 2. Following a resumption the number of tickets
90 issued will never be more than 1 regardless of the value set via
91 \&\fBSSL_set_num_tickets()\fR or \fBSSL_CTX_set_num_tickets()\fR. If \fBnum_tickets\fR is set to
92 0 then no tickets will be issued for either a normal connection or a resumption.
93 .PP
94 Tickets are also issued on receipt of a post-handshake certificate from the
95 client following a request by the server using
96 \&\fBSSL_verify_client_post_handshake\fR\|(3). These new tickets will be associated
97 with the updated client identity (i.e. including their certificate and
98 verification status). The number of tickets issued will normally be the same as
99 was used for the initial handshake. If the initial handshake was a full
100 handshake then \fBSSL_set_num_tickets()\fR can be called again prior to calling
101 \&\fBSSL_verify_client_post_handshake()\fR to update the number of tickets that will be
102 sent.
103 .PP
104 To issue tickets after other events (such as application-layer changes),
105 \&\fBSSL_new_session_ticket()\fR is used by a server application to request that a new
106 ticket be sent when it is safe to do so. New tickets are only allowed to be
107 sent in this manner after the initial handshake has completed, and only for
108 TLS 1.3 connections. By default, the ticket generation and transmission are
109 delayed until the server is starting a new write operation, so that it is
110 bundled with other application data being written and properly aligned to a
111 record boundary. If the connection was at a record boundary when
112 \&\fBSSL_new_session_ticket()\fR was called, the ticket can be sent immediately
113 (without waiting for the next application write) by calling
114 \&\fBSSL_do_handshake()\fR. \fBSSL_new_session_ticket()\fR can be called more than once to
115 request additional tickets be sent; all such requests are queued and written
116 together when it is safe to do so and triggered by \fBSSL_write()\fR or
117 \&\fBSSL_do_handshake()\fR. Note that a successful return from
118 \&\fBSSL_new_session_ticket()\fR indicates only that the request to send a ticket was
119 processed, not that the ticket itself was sent. To be notified when the
120 ticket itself is sent, a new-session callback can be registered with
121 \&\fBSSL_CTX_sess_set_new_cb\fR\|(3) that will be invoked as the ticket or tickets
122 are generated.
123 .PP
124 \&\fBSSL_CTX_get_num_tickets()\fR and \fBSSL_get_num_tickets()\fR return the number of
125 tickets set by a previous call to \fBSSL_CTX_set_num_tickets()\fR or
126 \&\fBSSL_set_num_tickets()\fR, or 2 if no such call has been made.
127 .SH "RETURN VALUES"
128 .IX Header "RETURN VALUES"
129 \&\fBSSL_CTX_set_num_tickets()\fR, \fBSSL_set_num_tickets()\fR, and
130 \&\fBSSL_new_session_ticket()\fR return 1 on success or 0 on failure.
131 .PP
132 \&\fBSSL_CTX_get_num_tickets()\fR and \fBSSL_get_num_tickets()\fR return the number of tickets
133 that have been previously set.
134 .SH "SEE ALSO"
135 .IX Header "SEE ALSO"
136 \&\fBssl\fR\|(7)
137 .SH HISTORY
138 .IX Header "HISTORY"
139 \&\fBSSL_new_session_ticket()\fR was added in OpenSSL 3.0.0.
140 \&\fBSSL_set_num_tickets()\fR, \fBSSL_get_num_tickets()\fR, \fBSSL_CTX_set_num_tickets()\fR, and
141 \&\fBSSL_CTX_get_num_tickets()\fR were added in OpenSSL 1.1.1.
142 .SH COPYRIGHT
143 .IX Header "COPYRIGHT"
144 Copyright 2018\-2021 The OpenSSL Project Authors. All Rights Reserved.
145 .PP
146 Licensed under the Apache License 2.0 (the "License"). You may not use
147 this file except in compliance with the License. You can obtain a copy
148 in the file LICENSE in the source distribution or at
149 <https://www.openssl.org/source/license.html>.