Skip to main content

Relax python default SSL Context verification flags

Project description

SSL Context Relaxer

Relax the SSL verification strictness introduced in python 3.13

Monkeypatching structure inspired by truststore

Usage

Install the library

pip install context-relaxer

At the entry point of your project, inject the monkeypatch

import context_relaxer

context_relaxer.inject_into_ssl()

Rationale

Many corporates have systems that proxy internal traffic, and sometimes they produce broken certificates.

Yes, they should be fixed, No, probably won't be fixed soon, but that doesn't mean you should pass verify=False or ssl_verify=False to every HTTPS session instance.

Usage with truststore

You can use this concurrently with truststore, as we monkey patch different properties of ssl, this library patches the default context creation function and truststore patches the SSLContext class.

Usage example (the order doesn't matter)

import context_relaxer
import truststore

truststore.inject_into_ssl()
context_relaxer.inject_into_ssl()

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

context_relaxer-0.0.1.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

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

context_relaxer-0.0.1-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file context_relaxer-0.0.1.tar.gz.

File metadata

  • Download URL: context_relaxer-0.0.1.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.5

File hashes

Hashes for context_relaxer-0.0.1.tar.gz
Algorithm Hash digest
SHA256 1d04f0bf564d65f77517031f2079bb00ae14dd06e85550a732ad301b4c9c33da
MD5 c270ba488dcd05a8bb46a1b41ca7b08f
BLAKE2b-256 0a32915c3567ff29b096d8ec3983a0191ac916b948711d0b0ed1d2a52a4a1da4

See more details on using hashes here.

File details

Details for the file context_relaxer-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for context_relaxer-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5950e9dc3200f24803d0aebc2b8e83672ba65c6767538d3e9e0d710b09b0ee91
MD5 34a11d8ae8c7b374ccfd5b1553a9666e
BLAKE2b-256 d9530d5b8ceef4c1724830edffbd00a2b030250477d1de8e6de59ed62b903a81

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