Skip to content

rustls: update to 0.15, add SSLKEYLOGFILE, client certs, ECH, platform verifier #16828

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 10 commits into from

Conversation

cpu
Copy link
Contributor

@cpu cpu commented Mar 25, 2025

👋 Hi folks,

This PR updates the rustls-ffi vTLS backend to use the ✨ literally brand-new ✨ rustls-ffi 0.15 release.

Beyond updating rustls-ffi/rustls this branch brings:

  • An update to the RUSTLS.md documentation to match upstream changes.
  • A simplification of CI, using the upstream .deb for installation.
  • Support for SSLKEYLOGFILE (originally implemented by @yedayak in Rustls: Support sslkeylogfile #15803)
  • Support for client certificate authentication (originally implemented by @yedayak in Rustls client auth yedayak/curl#2)
  • Support for Encrypted Client Hello (ECH): via GREASE, with a string ECH config list, and with DoH ECH config list fetching.
  • Support for native platform certificate validation: on Windows, MacOS, iOS, and Android via rustls-platform-verifier integration.

I've done this commit-by-commit to aid reviewability, and to preserve the authorship of @yedayak for the commits they contributed that I modified.

Continues from #16796
Replaces #16827
Replaces #15803

cpu and others added 10 commits March 25, 2025 11:32
Describes using a package manager or pre-built binaries and adopts the
0.15 installation from source instructions.

Previously the rustls docs described installing rustls-ffi from source
using the GNU Makefile. The upstream project has switched to using
cargo-c as a cross-platform solution that works well with the rust
toolchain, pkg-config, and Windows and so this needs an update.

Similarly, for folks that want to avoid the extra cargo-c tool
requirement, rustls-ffi provides binary releases for common platforms,
and some Linux distributions/package managers offer pre-built packages.

The install instructions are expanded to cover these options since
they're generally better for end users than building the dep. from
source (no `rustc` required).
Take the latest rustls-ffi version and install it via the upstream
project's `.deb` for x86_64 linux.
This allows TLS implementations to use the constants for defining sizes
and verification.
With rustls-ffi 0.15+ we can set up a callback for writing TLS secrets
hooked up to call Curl_tls_keylog_write. To make sure the associated
file is cleaned up we update the Curl_ssl struct for the rustls-ffi vtls
backend to have a cleanup callback.
e.g. `curl --tlsv1.3 --ech grease ...`
e.g. `curl --tlsv1.3 --ech ecl:<BASE64 encoded ECH config list> ...`
e.g. `curl --ca-native ...`
@cpu cpu mentioned this pull request Mar 26, 2025
@bagder bagder closed this in 1d31f25 Mar 27, 2025
bagder pushed a commit that referenced this pull request Mar 27, 2025
e.g. `curl --tlsv1.3 --ech ecl:<BASE64 encoded ECH config list> ...`

Closes #16828
bagder pushed a commit that referenced this pull request Mar 27, 2025
@bagder
Copy link
Member

bagder commented Mar 27, 2025

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous Integration cmdline tool TLS
Development

Successfully merging this pull request may close these issues.

3 participants