rustls / rustls/rustls-platform-verifier
`rustls_platform_verifier::Verifier::new_with_extra_roots`: Improve error clarity for invalid certificates
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 158
- Forks
- 60
- Avg merge
- 5d 10h
- Merged PRs (30d)
- 3
Description
The error returned by rustls_platform_verifier::Verifier::new_with_extra_roots doesn't specify which of the provided extra roots was invalid:
pub fn new_with_extra_roots(
roots: impl IntoIterator<Item = pki_types::CertificateDer<'static>>,
crypto_provider: Arc<CryptoProvider>,
) -> Result<Self, TlsError> {
let extra_roots = roots
.into_iter()
.map(|root| {
SecCertificate::from_der(&root)
.map_err(|_| TlsError::InvalidCertificate(CertificateError::BadEncoding))
})
.collect::<Result<Vec<_>, _>>()?;
Ok(Self {
extra_roots,
#[cfg(any(test, feature = "ffi-testing", feature = "dbg"))]
test_only_root_ca_override: None,
crypto_provider,
})
}
Would there be a way (and interest) in at least mentioning the index of the faulty certificate?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at rustls_platform_verifier::Verifier::new_with_extra_roots, especially the extra-roots conversion shown in the issue, and inspect how TlsError represents invalid certificates. Define the error wording and index behavior, then verify that an invalid root identifies its position without changing successful root handling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cryptography, security
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100