Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Table of Contents
WHAT: certifi-linux
wraps certifi, but instead of distributing a certificate like certifi
does, it uses the Linux system trust store.
WHY? The requests module depends on certifi
and uses it for TLS. certifi
distributes the collection of root certificates provided by Mozilla for Python deployments. In some cases, especially in an enterprise setup it is necessary to use the certificates which are shipped with the OS.
certifi-linux
is purposed for Linux! For Windows take a look at pip-system-certs.
pip install certifi-linux
certifi-linux
just needs to be installed. Afterwards certifi.where()
or $ python3 -m certifi
will return the path to the system store. Hence all dependent projects like requests
will do as well.
I am trying to keep tests up to date with endoflife.
Tested distros are:
Yet untested: Arch, Slackware, OpenWRT, FreeBSD, SUSE, gentoo, ...
certifi-linux
monkey patches certif.where
and certifi.contents
by using wrapt. When called, it searches in the defined set of possible certificate bundle paths for a match.
Tested: yesā , noā
Cert Bundle Path | Linux Distribution |
---|---|
/etc/ssl/cert.pem | fedora >= 3.4ā , RHELā , alpineā , centOS Streamā , Archā, OpenWRTā, FreeBSDā |
/etc/pki/tls/cert.pem | fedora <= 3.3ā |
/etc/ssl/certs/ca-certificates.crt | Debianā , Ubuntuā |
/etc/ssl/ca-bundle.pem | openSUSEā |
The idea behind certifi-linux
is the same as behind certifi-system-store. certifi-system-store
replaces the dist-info of certifi with its own dist-info. This approach needs a specific order of installation for a succesful patch. When installed as a dependency among a whole set of dependencies this is hard to ensure and replacing dist-infos can mess up virtual environments.
pip-system-certs solves the same problem with a different approach. It monkey patches the requests.adapters.HTTPAdapter
and uses ssl.create_default_context
to load the OS certs. This works fine on Windows but has shown limitations on Linux as it does not work in some cases.
Viewed from the outside, certifi-debian is doing the exact same thing like certifi-linux
but just for debian. certifi-system-store-wrapper also does the same but with the necessity to set an environment variable.
Credits go to the developers of certifi-system-store
and pip-system-certs
as certifi-linux
is highly influenced by these two projects.
certifi-linux
is distributed under the terms of the MIT license.
FAQs
Certifi patch for using Linux cert trust stores
We found that certifi-linux demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Ā It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.