Skip to main content

A robust, user-friendly Python CLI tool for inspecting SSL/TLS certificates of remote servers.

Project description

Python Version License Tests Coverage PyPI version Downloads

ssl-checkup

A robust, modular Python CLI tool for inspecting SSL/TLS certificates of remote servers. Features comprehensive testing, clean architecture, colorized output, and detailed debugging capabilities.

Features

  • Certificate Analysis: Check SSL certificate validity, issuer, subject, and SANs for any host
  • Colorized Output: Beautiful, readable output with --no-color option for plain text
  • Debug Mode: Comprehensive troubleshooting with --debug flag
  • Flexible Output: Print PEM certificate, issuer, subject, or SANs only as needed
  • Error Handling: Graceful handling of DNS/socket errors with helpful messages
  • Modular Architecture: Clean, testable code structure with 95% test coverage
  • Easy Installation: Available on PyPI - install with pipx install ssl-checkup

Installation

For Users (Recommended)

Install with pipx for best isolation and to avoid dependency conflicts:

pipx install ssl-checkup

If you don't have pipx, install it first:

# On macOS with Homebrew
brew install pipx

# On Ubuntu/Debian
sudo apt install pipx

# Or with pip
pip install --user pipx
pipx ensurepath

Alternative: Install with pip (may cause dependency conflicts):

pip install ssl-checkup

After installation, run from anywhere:

ssl-checkup example.com

For Development

Clone and set up development environment:

git clone https://github.com/BaDxKaRMa/ssl-checkup.git
cd ssl-checkup

# Using uv (recommended)
uv sync
uv run ssl-checkup example.com

# Or using pip
pip install -e ".[dev,test]"
python -m ssl_checkup.main example.com

Usage

ssl-checkup [OPTIONS] WEBSITE[:PORT]

Arguments:

  • WEBSITE - Domain or IP address to check (default port: 443)
  • PORT - Optional custom port (e.g., example.com:8443)

Options

Option Description
--no-color Disable color output for plain text
-p, --print-cert Print the PEM certificate to stdout
--debug Enable debug output for troubleshooting
-i, --issuer Print only the certificate issuer
-s, --subject Print only the certificate subject
-a, --san Print only the Subject Alternative Names (SANs)
--insecure, -k Allow insecure connections (bypass certificate validation)
--version Show version and exit
-h, --help Show help message

Examples

Basic certificate check:

ssl-checkup example.com

Check custom port:

ssl-checkup example.com:8443

Print specific certificate fields:

ssl-checkup -i example.com          # Issuer only
ssl-checkup -s example.com          # Subject only
ssl-checkup -a example.com          # SANs only

Debug and troubleshooting:

ssl-checkup --debug example.com     # Detailed debug output
ssl-checkup --insecure expired.badssl.com  # Skip validation

Export certificate:

ssl-checkup -p example.com > cert.pem       # Save PEM certificate
ssl-checkup --no-color example.com > info.txt  # Plain text output

Requirements

  • Python: 3.11 or higher
  • Optional Dependencies:
    • termcolor>=3.1.0 (enhanced colorized output)
    • cryptography>=45.0.5 (advanced certificate parsing)

Note: The tool works without optional dependencies, with graceful fallbacks for missing features.

Development

Quick Start

# Clone and set up development environment
git clone https://github.com/BaDxKaRMa/ssl-checkup.git
cd ssl-checkup
uv sync

# Run tests
make test

# Run with coverage
make test-coverage

# Run all quality checks
make check-all

Contributing

  1. Fork and clone the repository
  2. Set up development environment: uv sync
  3. Run tests to ensure everything works: make test
  4. Make your changes with appropriate tests
  5. Run quality checks: make check-all
  6. **Submit a pull request`

Releasing (Maintainers)

This project uses automated PyPI publishing via GitHub Actions. To release a new version:

Option 1: Using Makefile (Recommended)

# Create and push a new release in one command
make release-push VERSION=1.1.0

Option 2: Manual Process

# 1. Update version in pyproject.toml
version = "1.1.0"

# 2. Commit and tag the release
git add pyproject.toml
git commit -m "Release v1.1.0"
git tag v1.1.0

# 3. Push to trigger automated PyPI upload
git push && git push --tags

What happens automatically:

  • GitHub Actions builds the package with uv
  • Runs quality checks with twine check
  • Uploads to PyPI using stored API token
  • New version is available within minutes

Requirements for automated releases:

  • PyPI API token stored in GitHub Secrets as PYPI_API_TOKEN
  • Version must follow semantic versioning (e.g., 1.0.0, 1.1.0, 2.0.0)

Troubleshooting

Common Issues

Missing dependencies:

# For development - sync all dependencies
uv sync

# Or install individual packages if needed
uv pip install termcolor cryptography

Connection issues:

# Use debug mode for detailed troubleshooting
ssl-checkup --debug example.com

# Test insecure connections for self-signed certificates
ssl-checkup --insecure your-internal-server.com

Installation issues:

# Ensure Python 3.11+
python --version

# Install with pipx (recommended for CLI tools)
pipx install ssl-checkup

# If pipx isn't available, install it first
pip install --user pipx
pipx ensurepath

# Alternative: Install with pip (may cause conflicts)
pip install ssl-checkup

# Or use uv for development
uv sync && uv run ssl-checkup example.com

# Force reinstall if needed
pipx reinstall ssl-checkup

License

GPL-3.0 License - see LICENSE file for details.


Project maintained by BaDxKaRMa. Contributions welcome!

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

ssl_checkup-1.0.2.tar.gz (36.3 kB view details)

Uploaded Source

Built Distribution

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

ssl_checkup-1.0.2-py3-none-any.whl (25.9 kB view details)

Uploaded Python 3

File details

Details for the file ssl_checkup-1.0.2.tar.gz.

File metadata

  • Download URL: ssl_checkup-1.0.2.tar.gz
  • Upload date:
  • Size: 36.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for ssl_checkup-1.0.2.tar.gz
Algorithm Hash digest
SHA256 f54099a2f95410895509a0379d8b40e39154f1a084b4750445f616ae8d92360a
MD5 55f5099878951754ca4aa94a676beb75
BLAKE2b-256 f3454336965f5afa9fdb185ce445c07b8610120a1af52a2a9497115eaebba62c

See more details on using hashes here.

File details

Details for the file ssl_checkup-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: ssl_checkup-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 25.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for ssl_checkup-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4331897c84be3fd0bdcf7c81d0e07c929fd90a1e6c0423bcc6fe6d662c12ab7e
MD5 0b3c938e801cb5f780bd02a5e1c968f2
BLAKE2b-256 1554dc1dc4b55fe0a963236ba7e3c1e6baecc0467d747b0c1ea16934e6fef804

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