Skip to main content

Chase authority information access from a host certificate to complete the chain of trust.

Project description

AIA Chaser

Poetry License: MIT Linter: Ruff Code style: black Imports: isort pre-commit

PyPI - Version PyPI - Python Version

Read the Docs

This package helps automatically retrieve missing certificates to complete a secure SSL chain of trust. It ensures that even if a server doesn’t provide the full certificate chain, your connection remains secure.

What is AIA Chasing?

AIA (Authority Information Access) is a feature in SSL certificates, defined in RFC 5280, that points to:

  • CA Issuers – To fetch missing issuer certificates.
  • OCSP – To check if a certificate has been revoked.

By following these links, this package helps fill in the gaps, ensuring your SSL connections don’t fail due to missing certificates.

Why Does This Matter?

Sometimes, a website works fine in your browser but fails when using curl or Python’s requests library. That is because browsers often handle AIA chasing automatically, while other tools don’t. If you’ve run into SSL errors like this, this package can help! :guide_dog:.

Examples

The following examples showcase how to use this library with some typical Python HTTP libraries.

  • Standard library's urlopen:
from urllib.request import urlopen
from aia_chaser import AiaChaser

url = "https://..."

chaser = AiaChaser()
context = chaser.make_ssl_context_for_url(url)
response = urlopen(url, context=context)
import requests
from aia_chaser import AiaChaser
from aia_chaser.utils.cert_utils import temp_pem_file

url = "https://..."

chaser = AiaChaser()
ca_chain = chaser.fetch_ca_chain_for_url(url)
with temp_pem_file(ca_chain) as pem_path:
    response = requests.get(url, verify=str(pem_path))
import urllib3
from aia_chaser import AiaChaser

url = "https://..."

chaser = AiaChaser()
context = chaser.make_ssl_context_for_url(url)
with urllib3.PoolManager(ssl_context=context) as pool:
    respone = pool.request("GET", url)
import httpx
from aia_chaser import AiaChaser

url = "https://..."

chaser = AiaChaser()
context = chaser.make_ssl_context_for_url(url)
# Note: httpx does not follow redirects by default
with httpx.Client(verify=context, follow_redirects=True) as client:
    response = client.get(url)
import aiohttp
from aia_chaser import AiaChaser

url = "https://..."

chaser = AiaChaser()
context = chaser.make_ssl_context_for_url(url)
async with aiohttp.ClientSession() as session:
    async with session.get(url, ssl=context) as response:
        data = await response.text()
import pycurl
from aia_chaser import AiaChaser
from aia_chaser.utils.cert_utils import temp_pem_file

url = "https://..."

chaser = AiaChaser()
ca_chain = chaser.fetch_ca_chain_for_url(url)
with temp_pem_file(ca_chain) as pem_path:
    curl = pycurl.Curl()
    curl.setopt(pycurl.URL, url)
    curl.setopt(pycurl.CAINFO, str(pem_path))
    curl.perform()
    curl.close()

Acknowledgments

  • This project is based on aia.

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

aia_chaser-3.4.0.tar.gz (21.4 kB view details)

Uploaded Source

Built Distribution

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

aia_chaser-3.4.0-py3-none-any.whl (22.8 kB view details)

Uploaded Python 3

File details

Details for the file aia_chaser-3.4.0.tar.gz.

File metadata

  • Download URL: aia_chaser-3.4.0.tar.gz
  • Upload date:
  • Size: 21.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for aia_chaser-3.4.0.tar.gz
Algorithm Hash digest
SHA256 47b3f64b665661ec320768cd0e467bfe983bfdf9cf96902f1a48a4060064f34d
MD5 299eab9eb24dbcf3451cfdb744863ec5
BLAKE2b-256 d2e02cf340a9c71f4a7ca0945786c0259766917cfa6f1d6d1aba30accdba971a

See more details on using hashes here.

File details

Details for the file aia_chaser-3.4.0-py3-none-any.whl.

File metadata

  • Download URL: aia_chaser-3.4.0-py3-none-any.whl
  • Upload date:
  • Size: 22.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for aia_chaser-3.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 95d08baeb2e76d35e9f9684000f4e66320a82e699b95b528a84ec1c5e7bf1284
MD5 e3693dd1002e959cced8d5c6099e5602
BLAKE2b-256 8a6cfd5836912b13018b869397109ef1ad1a6f78ca907d21a8be3cf33855a317

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