Rustls 0.23.42, RFC 9149 API, check ALPN fix, and cbindgen update#655
Merged
Conversation
rustls 0.23.42 added opt-in support for the RFC 9149 ticket_request extension. Expose both halves via the C API: - rustls_client_config_builder_set_send_ticket_request() populates ClientConfig::send_ticket_request, offering the extension with the given new-session and resumption ticket counts. The default remains to not send the extension. - rustls_server_config_builder_set_max_tls13_tickets() populates ServerConfig::max_tls13_tickets, the cap applied to client ticket requests. The default remains 0 (requests ignored). The demo client/server get new REQUEST_TLS13_TICKETS/EXPECT_TLS13_TICKETS and MAX_TLS13_TICKETS env vars, and a new integration test verifies end-to-end that a client requesting under the server max receives the requested count while a request over the max is capped, using rustls_connection_get_tls13_tickets_received().
The setter added previously stored check_selected_alpn on the FFI builder but rustls_client_config_builder_build() never copied it to the ClientConfig, so disabling the check had no effect.
Regenerates rustls.h with the new version. cbindgen 0.29 moves rustls_handshake_kind after rustls_tls_version and emits enums with a fixed representation (rustls_result) using C23 typed enum syntax, guarded by __STDC_VERSION__ >= 202311L preprocessor conditionals. Tree-sitter's C grammar can't parse a preprocessor conditional in the middle of an enum declaration, so teach docgen to resolve the C23 guards to the pre-C23 branch before parsing. This restores the header shape older cbindgen emitted and produces identical api.json content modulo the enum reordering.
djc
approved these changes
Jul 14, 2026
Member
|
Nice! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This started as a straight update of the rustls dep to 0.23.42 and adding the new APIs, but grew a bugfix to #636 I noticed along the way, and a
cbindgenupdate so I don't have to keep remembering to use an older pinned version.Beyond the expected change in formatting/ordering from a new
cbindgenI also had to hack around the tree-sitter-c grammar's inability to cope with a preprocessor conditional in an enum definition in order for thedocgentool to not barf on the new.h. I think the solution I landed on isn't too gross overall and unblocks thecbindgenupdate.