chore(examples): refresh TLS dev dependencies#138
Merged
Conversation
Bumps the TLS example/dev dependency stack to maintained current
rustls-family crates:
- tokio-rustls 0.24 -> 0.26
- rustls-pemfile 1.0 -> 2.2 (RUSTSEC-2025-0134, 1.x unmaintained)
- webpki-roots 0.23 -> 1.0
This drops the old ring 0.16 line that came through webpki-roots 0.23 /
rustls-webpki 0.100 and pulls in rustls 0.23 with rustls-pki-types.
Migrates the TLS examples to the new APIs:
- ServerName now lives in rustls::pki_types
- RootCertStore is populated directly from webpki_roots::TLS_SERVER_ROOTS
(OwnedTrustAnchor / from_subject_spki_name_constraints removed)
- ClientConfig/ServerConfig builders no longer expose with_safe_defaults
- rustls_pemfile::{pkcs8_private_keys, certs} now return iterators of
Result<CertificateDer<'static>> / Result<PrivatePkcs8KeyDer<'static>>
- Certificate/PrivateKey newtypes replaced by CertificateDer and
PrivateKeyDer::Pkcs8
Co-Authored-By: Divy Srivastava <me@littledivy.com>
littledivy
approved these changes
Jun 6, 2026
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.
Summary
Refreshes the TLS example/dev dependency stack to current maintained rustls-family crates:
tokio-rustls0.24 → 0.26rustls-pemfile1.0 → 2.2 (1.x is unmaintained per RUSTSEC-2025-0134)webpki-roots0.23 → 1.0Lockfile effect: drops the old
ring 0.16/rustls-webpki 0.100/0.101/webpki-roots 0.23line and brings inrustls 0.23,rustls-pki-types 1.x,rustls-webpki 0.103, andaws-lc-rs 1.17(the default crypto provider intokio-rustls 0.26).API migration
The two TLS examples (
examples/tls_client.rs,examples/tls_server.rs) are updated for the rustls 0.21 → 0.23 changes:ServerNamenow lives inrustls::pki_types.RootCertStoreis built directly fromwebpki_roots::TLS_SERVER_ROOTS—OwnedTrustAnchor::from_subject_spki_name_constraintsis gone.ClientConfig::builder()/ServerConfig::builder()no longer exposewith_safe_defaults()— chainwith_root_certificates(...).with_no_client_auth()directly.rustls_pemfile::pkcs8_private_keys/certsnow return iterators ofResult<PrivatePkcs8KeyDer<'static>>/Result<CertificateDer<'static>>. Collected with.collect::<std::io::Result<Vec<_>>>()?.rustls::Certificate/rustls::PrivateKeynewtypes are replaced byCertificateDerandPrivateKeyDer::Pkcs8fromrustls::pki_types.The WebSocket library API is unchanged — only dev/example TLS plumbing is touched.
Test plan
cargo build --locked --all-features --all-targets(compiles both examples and the rest of the workspace)cargo test --locked --all-features(lib + doc + trybuild + upgrade/concurrency/split tests pass)cargo fmt -- --checkcd fuzz && cargo check --lockedCloses denoland/divybot#507