Skip to content

Rustls 0.23.42, RFC 9149 API, check ALPN fix, and cbindgen update#655

Merged
cpu merged 4 commits into
rustls:mainfrom
cpu:ci/cpu-rustls-0.23.42
Jul 15, 2026
Merged

Rustls 0.23.42, RFC 9149 API, check ALPN fix, and cbindgen update#655
cpu merged 4 commits into
rustls:mainfrom
cpu:ci/cpu-rustls-0.23.42

Conversation

@cpu

@cpu cpu commented Jul 14, 2026

Copy link
Copy Markdown
Member

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 cbindgen update so I don't have to keep remembering to use an older pinned version.

Beyond the expected change in formatting/ordering from a new cbindgen I 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 the docgen tool to not barf on the new .h. I think the solution I landed on isn't too gross overall and unblocks the cbindgen update.

cpu added 4 commits July 14, 2026 13:16
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.
@cpu cpu self-assigned this Jul 14, 2026
@djc

djc commented Jul 14, 2026

Copy link
Copy Markdown
Member

Nice!

@cpu
cpu merged commit 2605428 into rustls:main Jul 15, 2026
46 checks passed
@cpu
cpu deleted the ci/cpu-rustls-0.23.42 branch July 15, 2026 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants