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

Update to allow use of webpki-roots where rustls-native-certs fails. #102

Merged

Conversation

ZaneHannanAU
Copy link

@ZaneHannanAU ZaneHannanAU commented Jan 24, 2020

This adds the option to use webpki-roots in the cases where rustls-native-certs fails or is impossible, for example aarch64-linux-android (rustls/rustls-native-certs#3 is not possible, as the keystore is unavailable as per https://developer.android.com/training/articles/keystore), aarch64-unknown-none (it literally doesn't exist), microcontroller classes, x86_64-unknown-cloudabi/aarch64-unknown-cloudabi (also doesn't exist), wasm32-wasi (needs embedded or local thing), etc.

This additionally adds a compile time check for handling root store without required feature.

@ZaneHannanAU
Copy link
Author

Okay, for the time being leaving out the all-features variant with regards to this:

#[cfg(all(
    feature = "tokio-runtime",
    any(not(feature = "rustls-native-certs"), feature = "webpki-roots"),
    any(not(feature = "webpki-roots"), feature = "rustls-native-certs")
))]
compile_error!(
    "Must enable exactly one of rustls-native-certs (default) or webpki-roots with tokio-runtime! (note: use `default-features = false' in a binary crate for one or other)"
);

@ZaneHannanAU
Copy link
Author

As an alternative, I have https://github.com/ZaneHannanAU/rustls-native-certs/tree/allow-webpki-roots-on-unsupported-platform set up.

[path.crates-io]
rustls-native-certs = { git = "https://github.com/ZaneHannanAU/rustls-native-certs", branch = "allow-webpki-roots-on-unsupported-platform" }

@DoumanAsh
Copy link

DoumanAsh commented Jan 31, 2020

To be honest considering that rustls-native-certs is not really working wel(outside of Linux)l it would be better if webpki-roots would be default option

@ctz ctz merged commit 5422cd9 into rustls:master Feb 2, 2020
@ctz
Copy link
Member

ctz commented Feb 2, 2020

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.

3 participants