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)
Regardless of allow_private_ip, AiaChaser's own downloads (AIA CA issuers,
OCSP, and CRL) only use HTTP and HTTPS: file://, ftp://, and data: URLs
are rejected, and redirects to other schemes are not followed.
With this option disabled, AiaChaser additionally validates DNS results and
pins connections for the initial host, AIA download URLs, and OCSP/CRL
revocation endpoints 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. Environment proxies are also ignored when this option is
disabled to prevent bypassing address pinning. 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)
# Note: increase max_line_size/max_field_size if the host returns large headers (e.g. CSP)
async with aiohttp.ClientSession(max_line_size=65536, max_field_size=65536) 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.6.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 | Actions |
|---|---|---|---|---|
| aia_chaser-3.6.0.tar.gz | 29.5 kB | Without provenance | Details for aia_chaser-3.6.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aia_chaser-3.6.0-py3-none-any.whl | Python 3 | none | any | Details for aia_chaser-3.6.0-py3-none-any.whl |
Total release size: 61.4 kB
Release files / aia_chaser-3.6.0.tar.gz
| Download URL | aia_chaser-3.6.0.tar.gz |
|---|---|
| Size | 29.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0ab8b79018ce1083f60b70deb6b063c381fb5755901a7964a4b15d3c1f11e5b2
|
|
BLAKE2b-256 checksum How to use checksums |
70fcd606dcc4084fca1369753ef435bd67589fef7de1e7de9252d268db9bcc2b
|
| 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.6.0-py3-none-any.whl
| Download URL | aia_chaser-3.6.0-py3-none-any.whl |
|---|---|
| Size | 31.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
74219d353e20b013fcab3613cf2884bf0eb26c3db8a0322e80edeb0be5918956
|
|
BLAKE2b-256 checksum How to use checksums |
4ad29653bc3cf7e9543d24cfa68e92b7753cf976641cbbc898356e68b5bd1257
|
| 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.6.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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.