A powerful, developer-friendly Python tool to analyze TLS/SSL certificates for any domain.
- β¨ Check TLS Certificate β¨
- Comprehensive Analysis: Fetches leaf & intermediate certificates (AIA fetching)
- Chain Validation: Validates against system trust store
- Profile Detection: Detects usage profiles (server, email, code signing, etc.)
- CRL & Transparency: Checks CRL status and certificate transparency logs
- OCSP Check: Perform OCSP revocation checks for leaf certificates.
- CAA Check: Display DNS CAA records for the domain.
- Flexible Output: Human-readable (color), JSON, CSV
- Web UI: Interactive browser-based analysis
- Dockerized: Use with zero local setup
pipx
installs CLI tools in isolated environments, avoiding dependency conflicts and keeping your system clean.
pipx install check-tls
pip install check-tls
docker pull obeoneorg/check-tls:latest
Analyze a domain:
check-tls example.com
Run the web UI:
check-tls --server
Visit http://localhost:8000 in your browser.
Example: Command-line output for analyzing a domain (including OCSP status)
Analyze a domain:
check-tls example.com
# Or with a full URL (port in URL overrides --connect-port)
check-tls https://example.net:9000
Analyze multiple domains, output JSON:
check-tls google.com https://github.com:443 -j report.json
Human-readable output (default), or use -j
for JSON and -c
for CSV.
When analyzing several domains, the CLI now shows a small progress message for
each domain (e.g. π [2/3] Analyzing example.com:443... done
).
Key options:
-j, --json FILE
Output JSON (use "-" for stdout)-c, --csv FILE
Output CSV (use "-" for stdout)-P CONNECT_PORT, --connect-port CONNECT_PORT
Port to connect to for TLS analysis (default: 443). This is overridden if port is specified in domain/URL string e.g. example.com:1234 or https://example.com:1234-k, --insecure
Allow self-signed certs-s, --server
Launch web UI-p, --port
Web server port (for the UI, not for TLS connection)--no-transparency
Skip transparency check--no-crl-check
Skip CRL check--no-ocsp-check
Disable OCSP revocation check (enabled by default)--no-caa-check
Disable DNS CAA check
The TLS Analyzer also provides a REST API for programmatic access. By default, the web server listens on port 8000.
- Endpoint:
/api/analyze
- Method:
POST
- Content-Type:
application/json
- Request Body:
domains
(array of strings, required): List of domains to analyze (e.g.["example.com", "google.com"]
)insecure
(optional, boolean): Allow insecure (self-signed) certsno_transparency
(optional, boolean): Skip certificate transparency checkno_crl_check
(optional, boolean): Disable CRL checkno_ocsp_check
(optional, boolean): Disable OCSP checkno_caa_check
(optional, boolean): Disable CAA check
curl -X POST http://localhost:8000/api/analyze \
-H "Content-Type: application/json" \
-d '{"domains": ["example.com", "google.com"], "insecure": true, "no_transparency": true}'
[
{
"domain": "example.com",
"status": "completed",
"analysis_timestamp": "2025-04-26T08:30:00+00:00",
"connection_health": { ... },
"validation": { ... },
"certificates": [ ... ],
"crl_check": { ... },
"transparency": { ... }
},
...
]
The tool provides the following OCSP statuses for the leaf certificate:
good
: The certificate is valid according to its OCSP responder.revoked
: The certificate has been revoked according to its OCSP responder.unknown
: The OCSP responder replied with an "unknown" status for the certificate. This means the responder doesn't have information about the certificate's status.error
: An error occurred while trying to perform the OCSP check (e.g., network issue, responder unavailable, malformed response). The specific error details are usually provided.no_ocsp_url
: The certificate does not contain an OCSP URI.skipped
: The OCSP check was not performed because the--no-ocsp-check
flag was used or it was not applicable.
Example: HTML-based interactive certificate analysis (including OCSP status)
- User-friendly web UI for interactive analysis
- Supports all CLI options via the browser
- Great for demos, teams, and non-CLI users!
- Includes a light/dark theme toggle
check-tls
supports shell completion for bash, zsh, and fish. This helps you quickly fill in command-line options and arguments by pressing the <Tab>
key.
To enable completion, you need to add a short script to your shell's configuration file. Use the command below for your specific shell (or create a file in your shell's config directory with the appropriate content, to make it persistent across sessions):
Bash:
Add the following line to your ~/.bashrc
or ~/.bash_profile
:
eval "$(check-tls --print-completion bash)"
**Zsh:**
Add the following line to your `~/.zshrc`:
```sh
eval "$(check-tls --print-completion zsh)"
**Fish:**
Add the following line to your `~/.config/fish/config.fish`:
```sh
check-tls --print-completion fish | source
--
## ποΈ Project Structure
```text
check-tls/
βββ src/
β βββ main.py # CLI entry point
β βββ web_server.py # Flask web server
β βββ tls_checker.py # Core logic
β βββ utils/ # Utility modules
β βββ cert_utils.py
β βββ crl_utils.py
β βββ crtsh_utils.py
β βββ __init__.py
βββ pyproject.toml
βββ Dockerfile
βββ README.md
βββ ...
Q: Can I use this tool without Python installed?
A: Yes! Use the Docker image for zero local dependencies.
Q: How do I analyze multiple domains at once?
A: Just list them: check-tls domain1.com domain2.com ...
Q: How do I get JSON or CSV output?
A: Use -j file.json
or -c file.csv
. Use -
for stdout.
Q: Is this safe for self-signed certificates?
A: Use the -k
or --insecure
flag to allow fetching certs without validation.
Q: Can I run this as a web service?
A: Yes! Use check-tls --server
or the Docker web mode.
Q: Where are the logs?
A: By default, logs print to the console. Use -l DEBUG
for more detail.
Problem: ModuleNotFoundError
or import errors after moving files
- Solution: Make sure you installed with
pip install .
from the project root, and that you run scripts viacheck-tls ...
orpython -m src.main ...
.
Problem: ERROR: ... does not appear to be a Python project: 'pyproject.toml' not found.
- Solution: Ensure
pyproject.toml
is at the project root, not insidesrc/
.
Problem: Web server runs but browser shows error
- Solution: Check the logs for Python exceptions, and ensure Flask is installed.
Problem: Docker build fails or can't find files
- Solution: Make sure your Dockerfile matches the new project structure and copies both
pyproject.toml
and thesrc/
folder.
Problem: Can't bind to port 8000
- Solution: Make sure the port is not already in use, or use
-p
to specify a different port.
- All code is in
src/
(import asfrom src.utils import ...
) - Add new features as modules in
src/
orsrc/utils/
- Run tests and lint before submitting PRs
- For development, use
pip install -e .
to enable editable installs.
Pull requests are welcome! Please open an issue to discuss major changes.
MIT License Β© GrΓ©goire Compagnon (obeone)
To publish a new version to PyPI, push a new release to GitHub. The GitHub Actions workflow will build and publish automatically if the release tag matches the version in pyproject.toml
.
See .github/workflows/publish-to-pypi.yaml
for details.