Skip to main content

Patch httpx to use system certificates authority bundles by default

Project description

# httpx-system-certs

This package patches httpx.AsyncClient, httpx.AsyncHTTPTransport, httpx.Client, httpx.HTTPTransport, httpx.Proxy, httpx.create_ssl_context, httpx.delete, httpx.get, httpx.head, httpx.options, httpx.patch, httpx.post, httpx.put, httpx.request and httpx.stream to use system certificates authority store by default allowing the use of self signed certificates.

## Installation

`bash pip install httpx-system-certs `

https sites trusted by your device should now also be trusted by httpx by default.

_Note: The package uses a .pth file to make the patching of httpx methods available to the python interpreter. In some environments you might need to apply the patch manually using “import httpx_system_certs” before using httpx in your code._

## Functionnality

This package uses higher order functions to patch httpx methods by providing a default value to ssl.SSLContext type arguments. This is done by inspecting the type annotation of the method’s arguments and using the truststore package to create a new SSLContext instance with the system certificates authority store.

## Aknowledgements

This package development was inspired by [Andrew Leech’s pip-system-certs package](https://gitlab.com/alelec/pip-system-certs)

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

httpx_system_certs-1.0.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

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

httpx_system_certs-1.0.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file httpx_system_certs-1.0.0.tar.gz.

File metadata

  • Download URL: httpx_system_certs-1.0.0.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for httpx_system_certs-1.0.0.tar.gz
Algorithm Hash digest
SHA256 051293d9cd88683cc6ce660be1888803f075dc464e51f98114b355a8ffbc2c33
MD5 46d606ddcc0c67b246f79c1f0a61d969
BLAKE2b-256 48747a095893610ee2e9920803cbc14704e2f46eebfbbeb8c7df03dc3dc5ce1e

See more details on using hashes here.

Provenance

The following attestation bundles were made for httpx_system_certs-1.0.0.tar.gz:

Publisher: test_and_release.yml on Baltoch/httpx-system-certs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file httpx_system_certs-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for httpx_system_certs-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dccdc7d26b9637f9f21ecc58e03ee168ba7ce5b1eb6e5a1df8efcc920ef30fd3
MD5 83beabfc3c9029be6ef184bfc370d0ca
BLAKE2b-256 e1c8d6cc42b2eeae151aad201d16f22951dfdbd0976e8b1f0e4d3fddafbc6425

See more details on using hashes here.

Provenance

The following attestation bundles were made for httpx_system_certs-1.0.0-py3-none-any.whl:

Publisher: test_and_release.yml on Baltoch/httpx-system-certs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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