-
Notifications
You must be signed in to change notification settings - Fork 178
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
platform-verifier as feature #818
Conversation
46f2f2d
to
b1221f4
Compare
Hey @cpu, I don't imagine there's anything we can do about the dep-count of the I know in some enterprise environments there might be requirement to use the platform roots. webpki crate is also not automatically updated, meaning a long lived service talking to some other service might just stop working without recompilation. Are there other considerations? |
Hi @algesten, This was a timely question. We're in the process of improving some of the platform verifier docs to hopefully help with this sort of evaluation.
Yes. With respect to using stale webpki-roots data I think the risk is less about a long-lived service not working due to a peer using certs chaining to a root it doesn't know about yet and more about that service continuing to work when it speaks to a peer using certs chaining to a root that was removed, e.g. due to a security event. There are also other considerations that make the platform verifier experience a more secure/robust one:
rusts-native-certs is somewhat of an in-between. It helps with the problem of "stale" root data, but it doesn't help with revocation, gradual distrust, SCTs, etc. It also seems to less robustly support enterprise roots injected into the local trust stores. In most cases we're pushing folks to stop using that crate and to use the platform verifier crate instead. I suspect there are other advantages but those are the ones top-of-mind for me. Hope that helps! |
@cpu Thanks a lot for that input. I had another thought yesterday, which is where is ureq typically used?. As I see it, although it is a generic http client, ureq is probably mostly used for HTTP API interactions (that's why For Linux, the platform verifier doesn't do much, right? It uses webpki, no revocations. Is there a big difference between using the cacerts installed by the distro vs the webpki-roots crate? |
np!
The platform verifier crate on Linux/BSD will end up using rustls-native-certs with In terms of skipping the platform verifier entirely and choosing between using If you don't trust us to keep If you don't plan to rebuild your application frequently (to pick up new Does that make sense? |
Tagging @complexspaces to keep me honest. Have I done an OK job summarizing? |
@k0nserv you often have strong opinions. What's your take on this? |
Another thought: if ureq is mostly used for HTTP APIs, the number of disparate certs the ureq instance would be subjected to is very limited. I think revocations would be an even less concern in a situation where one uses ureq to talk to the same 3-4 HTTP API as part of a service. If the assumption of ureq use holds, it means the decision of platform-verifier or webpki-roots is probably only about frequency of updates to webpki-roots needed to keep the service running. |
@cpu I think your explanation looks great! Thanks for writing that out here and tagging me in. After reading through this thread, I have a few followup comments:
This is an understandable concern! I tend to have a similar mindset myself when looking at dependency trees. However the other factor I consider is versioning: Are all the crates using versions that don't change often (or at all)? This significantly increases the chance downstream consumers lockfiles will merge together nicely and prevent the (worse, IMO) problem of duplicates from appearing. With all of that said, once the new version of Regarding the usage assumptions:
I don't think this is strictly true, IME. I have seen
I think I agree so far on this point: most tooling has an expected set of destinations baked in. But, there remains some value though, like if you are in an environment that forces network access to go through a proxy which requires a cert. |
DECISION: Leaving as-is (using Thank you both @cpu and @complexspaces very much for helping me with this one. |
b1221f4
to
3f21ad6
Compare
Another thought (and I don't expect anyone to answer this, I'm just capturing my thoughts on this PR) reqwest is a very good http client. It got a "blocking" feature, which makes it roughly equal to ureq. The history of ureq is that it started as a counter-reaction to needing a lot of dependencies for making a few HTTP calls. It might be true to say that one key differentiating factor in choosing ureq over reqwest, is the dependency count. If we try to pick the features "blocking", TLS, JSON and GZIP. Then count the deps and try to build. reqwest:
ureq with platform-verifier:
ureq without platform-verifier:
It's not very scientific, but is another data point. I should definitely take a closer look at the other deps in ureq. |
5859e75
to
b885fa9
Compare
b885fa9
to
a9f1922
Compare
I've decided to merge this PR, and it's not a decision made lightly (still not sure it's the right one). ureq main selling points are and always were:
With |
On (my) macOS, the
rustls-platform-verifier
crate introduces 9 dependencies:ureq tries to keep the number of dependencies low, and without this crate, using default features, have ~48. which means this dep alone is almost a 20% increase in dependencies. Given that ureq2.x shipped with webpki as the defaults roots, we might want to consider feature flagging the
rustls-platform-verifier
and defaulting to webpki also in 3.x.(as a side note, someone inspecting Cargo.lock will probably be surprised finding "jni" in their project - even if it's only used on android)