Skip to content

Add OpenSSL TLS 1.3 early data (0-RTT) support#22802

Merged
bukka merged 1 commit into
php:masterfrom
bukka:openssl_tls_early_data
Jul 25, 2026
Merged

Add OpenSSL TLS 1.3 early data (0-RTT) support#22802
bukka merged 1 commit into
php:masterfrom
bukka:openssl_tls_early_data

Conversation

@bukka

@bukka bukka commented Jul 19, 2026

Copy link
Copy Markdown
Member

This builds on the session resumption support to let clients send and servers accept TLS 1.3 early data through the stream SSL context.

Clients set the early_data context option (a string) to send 0-RTT data, which is only sent when the resumed session allows it. Servers enable acceptance with max_early_data and receive the data through the early_data_cb callback, so nothing is buffered on the stream. The outcome is reported as accepted, rejected or not_sent in the early_data key of the crypto stream_get_meta_data() array.

Enabling early data also shares the server SSL_CTX across accepted connections and keeps the session cache on, both of which 0-RTT resumption requires.

@arnaud-lb arnaud-lb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me (but I have limited knowledge of openssl, so this needs another review).

Comment thread ext/openssl/xp_ssl.c Outdated
Comment thread ext/openssl/xp_ssl.c Outdated
This builds on the session resumption support to let clients send and
servers accept TLS 1.3 early data through the stream SSL context.

Clients set the early_data context option (a string) to send 0-RTT data,
which is only sent when the resumed session allows it. Servers enable
acceptance with max_early_data and receive the data through the
early_data_cb callback, so nothing is buffered on the stream. The outcome
is reported as 'accepted', 'rejected' or 'not_sent' in the early_data key
of the crypto stream_get_meta_data() array.

Enabling early data also shares the server SSL_CTX across accepted
connections and keeps the session cache on, both of which 0-RTT
resumption requires.
@bukka
bukka force-pushed the openssl_tls_early_data branch from d8dd314 to 367dd71 Compare July 25, 2026 17:59
@bukka

bukka commented Jul 25, 2026

Copy link
Copy Markdown
Member Author

I have limited knowledge of openssl, so this needs another review

I think you have good enough knowledge. :) There is certainly no one who does not have limited knowledge so it would never get reviewed so better to just merge it. It's a simple addition that just follows structure what was added in session and psk support.

@bukka
bukka merged commit f465d35 into php:master Jul 25, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants