Method SSL.Context()->encode_ticket_1_3()

class SSL.Context

Method encode_ticket_1_3

array(string(8bit)|int)|zero encode_ticket_1_3(Session session, string(8bit) psk)

Description

TLS 1.3 (RFC 8446 section 4.6.1) analogue of encode_ticket(): issue a ticket carrying a resumption PSK, rather than TLS 1.0-1.2's master_secret-based ticket. Reuses the same session_cache storage and keying (by ticket bytes) as encode_ticket() -- decode_ticket()'s default implementation (a plain lookup_session()) works unchanged for either kind of ticket; the two are told apart by whether Session()->tls13_psk is set.

Parameter session

The just-completed TLS 1.3 connection's session. Its Session.identity is temporarily repointed at the new ticket for caching purposes, exactly as encode_ticket() does, then restored.

Parameter psk

The resumption PSK, derived by the caller from this connection's key_schedule->resumption_master_secret and a per-ticket nonce (RFC 8446 section 4.6.1).

Note

The caller is responsible for setting session->    tls13_alpn_protocol (from the connection's negotiated application_protocol, if any) before calling this -- that's connection-level state this Context method has no access to. max_early_data_size (below) is policy this Context does own, so it's applied here directly.

Returns
Array
string(8bit) 0

The opaque ticket, or 0 (zero) if tickets aren't offered.

int 1

Ticket lifetime in seconds.

int 2

The ticket_age_add obfuscation value (RFC 8446 section 4.2.11).

See also

encode_ticket(), decode_ticket()