-
Notifications
You must be signed in to change notification settings - Fork 39
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
Use system TLS certificates instead of certifi #1831
Comments
I don't think there's any straightforward way in pip nor poetry to swap out a dependency (see e.g. Cargo's patch: https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html), and monkey-patching is more explicit, so that's probably the way to go. |
I admittedly don't have tons of context in this area, but my understanding that is we used certifi because we specifically wanted to rely on certifi / Mozilla certs and not on the system handling of certs, eg due to historical bugs such as this one (summarized certifi/python-certifi#35 (comment)). That issue and discussion are ~8-10 years old, and I see there's been a fair bit of discussion in the requests community about using the system store for various reasons (lots of users with custom certs on corp networks, for example), and there are also newer projects like https://github.com/sethmlarson/truststore to facilitate using the system certificate store with Basically, I'm fine with making a change as long as we're aware of why we weren't doing it in the first place :), and as long as it's an informed choice and we aren't missing any historical context, since we make use of certifi in a number of fpf projects. |
I had forgotten about this ticket, but I appreciate the historical input, the CA ecosystem has thankfully improved a bit.
The client/SDK only used certifi during local development, which is going away in proxy v2. And in proxy v2, we're switching to the Rust
Ack. I'm going to move this into the client repo and tag it with proxy v2 so we consider it in that scope since we're effectively making this change at that time. |
certifi is a dependency of requests and a redistribution of the Mozilla-approved root certificates.
Debian (and Ubuntu) already redistribute this as the
ca-certificates
package (https://tracker.debian.org/pkg/ca-certificates) that's installed on basically every system. Using the system store means that we can rely on Debian/Ubuntu to provide security updates to revoke bad root certs automatically instead of us needing to manually supply updates.AFAIK requests no longer has an environment variable override to point at the system certificate store, instead they want you to override/patch the
certifi.where()
function. There's a certifi-debian fork on pypi that does that. (Despite the name it should also work on Fedora).So we could either replace
certifi
dependencies withcertifi-debian
, or monkey-patchcertifi.where()
in Python before requests is loaded.I believe this affects both the securedrop-sdk (which is embedded in -client) and securedrop-proxy components.
The text was updated successfully, but these errors were encountered: