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.3.tar.gz (3.3 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.3-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for context_relaxer-0.0.3.tar.gz
Algorithm Hash digest
SHA256 7992a654ab549e8118a1ab111bfae0049fe95e999cc8968c1a5888b20a4e0250
MD5 79d24147e76c4cb889055e5de0cc41bb
BLAKE2b-256 38b5bc41f623f009913fa0a378ea6db668ecadb6c23d301a0912da815d01eb43

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for context_relaxer-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 88ea546b835f75da078483cf8dba7739618a224bf4e63264da3cca1235d11eb4
MD5 a1a0eb5aa3157b027dd6876867bc75ae
BLAKE2b-256 050457233838a97fe45a5728b760299285ec4f8032c020ab562a8df402413ea7

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