Skip to content
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

Gracefully handle bad native certs #520

Merged

Conversation

NAlexPear
Copy link
Contributor

Description

Prevent problems reading individual certs from the cert store from interfering with the use of other valid certs when the tls-roots feature is enabled.

Fixes #519

Motivation

MacOS users will often have certs in their Trusted Settings Record that cannot be parsed by rustls_native_roots (used in conjunction with the tls-roots feature here). This change makes tls-roots usable for those users again.

Solution

Similar to this implementation in hyper-rustls, one-off errors are effectively ignored when loading the native cert store.

Instead of failing and bailing when a bad cert is found, ignore one-off
errors for bad certs and continue to load the rest of the store.

These one-off errors mostly affect MacOS users, as found in this
rustls-native-certs issue: rustls/rustls-native-certs#4

Fixes: hyperium#519
Copy link
Member

@LucioFranco LucioFranco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

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.

fragile loading of native certs on MacOS with tls-roots
2 participants