-
Notifications
You must be signed in to change notification settings - Fork 892
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
Suggestion: Use rustls/webpki-roots rather than rustls/native-tls for flexibility #3400
Comments
Sounds good; if someone wants to test this and put a patch up that would be great. |
Might also want to check in with cargo folks. I suspect they have a fair amount of experience with this sort of thing. |
@ChrisDenton I'm dropping @weihanglo's comments on Cargo's case here:
Footnotes
|
As a rustls maintainer, I have a fair amount of context on the trust root subtleties.
A third alternative is in the works, called rustls-platform-verifier, this originates from 1Password which uses this code in their clients and has a fair bit of experience.
My take away from this: I think rustls-platform-verifier would be a great fit for rustup, but it's not quite ready yet (even though there's a bunch of deployment experience from 1Password). However, as explained above, I don't think using webpki-roots (via
The next semver-breaking rustls release will add support for pluggable cryptographic primitive backends, so this should enable more options once pure-Rust backends actually exist.
rustup already uses curl today anyway, but without using rustls with it. @rami3l maybe link to where you found those comments? |
@djc Oh, I got that from a Telegram chat in Chinese requesting for his comments on this issue.
So when we are using the |
Those comments from @rami3l messaging me in private.
I was talking about TLS backend. Since Do we need to consider the scenario that rustup is used as a library? I don't exactly know the implication though. |
Well, it can also use reqwest, and ideally we'd move to only using reqwest + rustls in the future.
I don't think so. |
FWIW the current long-term plan seems to be having structured output or turning |
For the purpose of the current discussion, that's still more like a binary than a library. (It also seems like it would take a good while before we get there, so not sure it's worth agonizing much over at this point.) |
Sorry for not being clear enough, what I want to say by mentioning that issue is exactly that |
so it's better to use rustls-native-certs than webpki-roots now ? does the rustls-native-certs also use webpki to do verify ? |
There are trade-offs, read my earlier comment. But, FWIW, I prefer rustls-native-certs in most of my applications.
rustls-native-certs crate provides a way to get the trust roots from the operating system. Typically these trust roots will be passed into a |
I'm closing this now as we're now heading to another direction ( |
Problem you are trying to solve
While it doesn't affect me, I notice that a number of people have problems with Rustup, particularly in dockers or other smaller systems, when it comes to CA certificates and the like - shifting from openssl (no matter if vendored or not) to rustls/webpki-roots would allow rustup to embed the certificates needed to work cleanly, paving the way closer to a fully independent binary if desirable (ie built with musl where appropriate).
Solution you'd like
In a basic sense it ought to be as simple as:
rustls-tls-webpki-roots
feature ofreqwest
instead ofrustls-tls-native-roots
as is currently used.rustls/default-tls
However, for full flexibility, it might also be worthwhile to add support for loading additional CA certificates from file (or indeed from the system CA store as well) so that you can still support corporate installations which need to MITM web TLS connections. This may be possibly as simple as also enabling
rustls-tls-native-roots
in thereqwest
crate as well, in which case it might be sufficient to adjust1.
above with "as well as" in place of "instead of"Notes
No response
The text was updated successfully, but these errors were encountered: