AIA Chaser
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! 🦮.
Network Access
AiaChaser currently defaults to allow_private_ip=True for backwards
compatibility. This will default to False in v4. To use the stricter policy
now, set the option explicitly:
chaser = AiaChaser(allow_private_ip=False)
With this option disabled, AiaChaser validates DNS results and pins
connections for both the initial host and AIA download URLs to globally
routable unicast addresses. This mitigates SSRF by blocking connections to
localhost, private networks, link-local services (including common cloud
metadata endpoints), and multicast destinations. Public unicast hosts remain
reachable; this is not an outbound host allowlist.
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)
- Using Requests: HTTP for Humans:
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))
- Using urllib3:
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)
- Using httpx:
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)
- Using aiohttp (async):
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()
- Using PycURL:
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.
Metadata
Release files for aia-chaser 3.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| aia_chaser-3.5.0.tar.gz | 26.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aia_chaser-3.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 55.8 kB
Release files / aia_chaser-3.5.0.tar.gz
| Download URL | aia_chaser-3.5.0.tar.gz |
|---|---|
| Size | 26.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f0e50e61a5e3d21917d273b5af8a4375a48227e36fb6bdd952359933f40e9642
|
|
BLAKE2b-256 checksum How to use checksums |
e798cea1cb9b2a1d6469ac8ea7a737af5ab2234d0b83f5c2fc7b0f3776c99ae2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / aia_chaser-3.5.0-py3-none-any.whl
| Download URL | aia_chaser-3.5.0-py3-none-any.whl |
|---|---|
| Size | 29.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
44b4431d8538ddbe3d92ac9f08a003c4e52620e68e79a80425a2f2fc1a1511e4
|
|
BLAKE2b-256 checksum How to use checksums |
9fe771c0e66c89bcf17d9391cc504439f76f580e025df86b2decbe5e956315d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for aia-chaser 3.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.