Replace unmaintained rustls-pemfile with rustls-pki-types PemObject#280
Open
kofany wants to merge 1 commit intoaatxe:developfrom
Open
Replace unmaintained rustls-pemfile with rustls-pki-types PemObject#280kofany wants to merge 1 commit intoaatxe:developfrom
kofany wants to merge 1 commit intoaatxe:developfrom
Conversation
Migrate from `rustls-pemfile` to the `PemObject` trait provided by `rustls-pki-types` (available since v1.9.0, already a transitive dependency at v1.14.0). This resolves RUSTSEC-2025-0134. Closes aatxe#277
kpcyrd
approved these changes
Mar 29, 2026
Contributor
|
I'm also interested in this :) I currently get this in my project: |
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
Resolves RUSTSEC-2025-0134 by migrating from the unmaintained
rustls-pemfilecrate to thePemObjecttrait inrustls-pki-types(available since v1.9.0).As noted in the advisory,
rustls-pemfileis a thin wrapper around the same PEM parsing code now included directly inrustls-pki-types. The project already depends onrustls-pki-types v1.14.0transitively throughtokio-rustls, so this change removes a dependency rather than adding one.Changes
Cargo.toml: Removerustls-pemfilefrom[dependencies]andtls-rustfeature listsrc/client/conn.rs: Replace threerustls_pemfilecall sites withPemObjecttrait methods:rustls_pemfile::certs()→CertificateDer::pem_file_iter()rustls_pemfile::private_key()→PrivateKeyDer::from_pem_slice()FileandBufReaderimports from thetls-rustcfg blockCloses #277
Test plan
cargo check— default features (tls-native)cargo check --no-default-features --features tls-rust,...— tls-rust pathcargo clippy --all-targets --all-features— no new warningscargo test— 67 tests + 8 doc-tests passcargo test --no-default-features— 45 tests + 7 doc-tests passgit diff --check— no whitespace issues