As discussed in
Section 1, clients may want different numbers of tickets for new or resumed connections. Clients may indicate to servers their desired number of tickets to receive on a single connection, in the case of a new or resumed connection, via the following "ticket_request" extension:
enum {
ticket_request(58), (65535)
} ExtensionType;
Clients
MAY send this extension in ClientHello. It contains the following structure:
struct {
uint8 new_session_count;
uint8 resumption_count;
} ClientTicketRequest;
-
new_session_count:
-
The number of tickets desired by the client if the server chooses to negotiate a new connection.
-
resumption_count:
-
The number of tickets desired by the client if the server is willing to resume using a ticket presented in this ClientHello.
A client starting a new connection
SHOULD set new_session_count to the desired number of session tickets and resumption_count to 0. Once a client's ticket cache is primed, a resumption_count of 1 is a good choice that allows the server to replace each ticket with a new ticket without over-provisioning the client with excess tickets. However, clients that race multiple connections and place a separate ticket in each will ultimately end up with just the tickets from a single resumed session. In that case, clients can send a resumption_count equal to the number of connections they are attempting in parallel. (Clients that send a resumption_count less than the number of parallel connection attempts might end up with zero tickets.)
When a client presenting a previously obtained ticket finds that the server nevertheless negotiates a new connection, the client
SHOULD assume that any other tickets associated with the same session as the presented ticket are also no longer valid for resumption. This includes tickets obtained during the initial (new) connection and all tickets subsequently obtained as part of subsequent resumptions. Requesting more than one ticket when servers complete a new connection helps keep the session cache primed.
Servers
SHOULD NOT send more tickets than requested for the connection type selected by the server (new or resumed connection). Moreover, servers
SHOULD place a limit on the number of tickets they are willing to send, whether for new or resumed connections, to save resources. Therefore, the number of NewSessionTicket messages sent will typically be the minimum of the server's self-imposed limit and the number requested. Servers
MAY send additional tickets, typically using the same limit, if the tickets that are originally sent are somehow invalidated.
A server that supports and uses a client "ticket_request" extension
MUST also send the "ticket_request" extension in the EncryptedExtensions message. It contains the following structure:
struct {
uint8 expected_count;
} ServerTicketRequestHint;
-
expected_count:
-
The number of tickets the server expects to send in this connection.
Servers
MUST NOT send the "ticket_request" extension in any handshake message, including ServerHello or HelloRetryRequest messages. A client
MUST abort the connection with an "illegal_parameter" alert if the "ticket_request" extension is present in any server handshake message.
If a client receives a HelloRetryRequest, the presence (or absence) of the "ticket_request" extension
MUST be maintained in the second ClientHello message. Moreover, if this extension is present, a client
MUST NOT change the value of ClientTicketRequest in the second ClientHello message.