Skip to main content

Automatically configures Python to use system certificates via truststore

Project description

This package automatically configures Python to use system certificates from the OS certificate store instead of the bundled certificates via the truststore library.

This allows pip and Python applications to verify TLS/SSL connections to servers whose certificates are trusted by your system.

Simply install with:

pip install pip_system_certs

and Python will automatically use your system’s certificate store for all SSL verification.

This works for pip, requests, urllib3, and any other Python library that uses the standard SSL context.

Requirements

  • Python 3.10 or higher

  • pip 24.2 or higher (upgraded automatically if needed)

Compatibility

pip-system-certs uses pip’s built-in truststore library to inject system certificate verification into Python’s SSL context. This provides native OS integration using:

  • macOS: Security framework

  • Windows: CryptoAPI

  • Linux: OpenSSL with system certificate stores

This approach leverages the same truststore technology that pip uses internally, ensuring compatibility and reliability. It automatically works with any Python library that uses SSL (requests, urllib3, httpx, etc.).

If you encounter issues, please report them at https://gitlab.com/alelec/pip-system-certs/-/issues

Known Issues

  • conda virtual environments on Linux may install a separate SSL certificate store which takes precedence over the system store, potentially preventing this package from accessing system-installed certificates.

PyInstaller

The automatic certificate configuration relies on a .pth file that Python loads at startup. This method does not work when bundling applications with PyInstaller or similar tools.

For PyInstaller applications, manually enable system certificates by adding this line early in your main script:

import pip_system_certs.wrapt_requests; pip_system_certs.wrapt_requests.inject_truststore()

This must be called before any SSL connections are made.

Architecture

This package uses a bootstrap system to automatically inject system certificate support:

  1. A .pth file triggers the bootstrap when Python starts

  2. Uses pip’s vendored truststore library (pip 24.2+) for compatibility

  3. Calls truststore.inject_into_ssl() to globally configure system certificates

  4. All subsequent SSL connections (pip, requests, etc.) use the system certificate store

Acknowledgements

This package leverages pip’s vendored truststore library by Seth Michael Larson for system certificate integration. This ensures compatibility with modern pip versions while avoiding dependency conflicts.

The bootstrap system was originally inspired by the autowrapt module.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pip_system_certs-5.3.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pip_system_certs-5.3-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file pip_system_certs-5.3.tar.gz.

File metadata

  • Download URL: pip_system_certs-5.3.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for pip_system_certs-5.3.tar.gz
Algorithm Hash digest
SHA256 19c8bf9957bcce7d69c4dbc2d0b2ef13de1984d53f50a59012e6dbbad0af67c6
MD5 43b53564c019eb675f221c76be3779df
BLAKE2b-256 7d6a563b05a4f6c9ddc205c98bb413e74221368efb98b8fb9cca96b578b8930c

See more details on using hashes here.

File details

Details for the file pip_system_certs-5.3-py3-none-any.whl.

File metadata

  • Download URL: pip_system_certs-5.3-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for pip_system_certs-5.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3fbb5de62e374a99b688b1ad06e64ee5c4aeb633ef23e3a677d32e3e84fd863c
MD5 dc7ff318e433f218b37cff1d3b64edd9
BLAKE2b-256 9f57752b63c609affae8f26ae0f1d1103d6ea7e707ad45943f62f7422936071d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page