python-certifi README

项目的 README,来自 github.com/certifi/python-certifi。合并为一个 markdown 文件:README.md。

Certifi: Python SSL Certificates

Certifi provides Mozilla's carefully curated collection of Root Certificates for validating the trustworthiness of SSL certificates while verifying the identity of TLS hosts. It has been extracted from the Requests_ project.

Installation

certifi is available on PyPI. Simply install it with pip::

$ pip install certifi

Usage

To reference the installed certificate authority (CA) bundle, you can use the built-in function::

>>> import certifi

>>> certifi.where()
'/usr/local/lib/python3.7/site-packages/certifi/cacert.pem'

Or from the command line::

$ python -m certifi
/usr/local/lib/python3.7/site-packages/certifi/cacert.pem

Enjoy!

.. _Requests: https://requests.readthedocs.io/en/latest/

Addition/Removal of Certificates

Certifi does not support any addition/removal or other modification of the CA trust store content. This project is intended to provide a reliable and highly portable root of trust to python deployments. Look to upstream projects for methods to use alternate trust.

python-certifi (certifi/python-certifi)

正在搜索数据库…

这是什么?Certifi 是一个 Python 软件包,内置 Mozilla 精选的根 CA 证书集合,用于验证 SSL 证书是否可信,并核实 TLS 主机的身份。
这是我要导入的库,还是一个独立工具?它是一个发布在 PyPI 上的 Python 库,你需要在代码中导入它,以获取 CA 证书包的路径。不过它也提供了一个小型命令行入口。
我该如何安装和使用它?使用 'pip install certifi' 安装,然后在 Python 中调用 certifi.where() 获取 CA 证书包的路径;或者在命令行中运行 'python -m certifi' 来打印该路径。
我能自己往证书包里添加或删除证书吗?不能。Certifi 不支持修改其信任库的内容,它的设计目标是作为一个固定、可移植的信任根。因此,如果需要自定义信任配置,你需要使用上游项目。
根证书来自哪里?它们是 Mozilla 自己精选的一组受信任根证书,经过重新打包,便于在 Python 中使用。
Certifi 为什么会被单独拆分成一个项目?它最初是从 Requests 库中拆分出来的,这样其他 Python 项目就可以依赖一个可靠、可移植的 CA 证书包,而无需引入整个 Requests。
certifi.where() 到底返回什么?它返回已安装的 cacert.pem 证书包的文件路径,例如 '/usr/local/lib/python3.7/site-packages/certifi/cacert.pem',你可以把这个路径传给需要 CA 文件的 TLS 库。
有哪些类似的项目?certbot, requests, acme.sh, openssl, httpx, seaborn, playport, apsw
作者
certifi
大小
1.4 MB
星标
1K
更新
提交Nov 09
时长
14年
提交 · 90 天