Skip to main content

A Python package to analyze SSL certificates

Project description

SSL Analyzer

PyPI version
A Python-based SSL/TLS certificate analysis tool that retrieves detailed information about SSL certificates, including expiration, issuer, key details, and security attributes.


🔹 Features

👉 Extracts SSL/TLS version and cipher suite details
👉 Retrieves certificate issuer, subject, validity period
👉 Detects OCSP Must-Staple & self-signed certificates
👉 Analyzes public key strength (RSA, ECC, DSA)
👉 Extracts Subject Alternative Names (SAN)
👉 Calculates SHA-1 & SHA-256 fingerprints
👉 Supports CLI and JSON-formatted output


📛 Installation

Install the package via pip:

pip install ssl-analyzer

🚀 Usage

You can use ssl-analyzer via CLI or as a Python module.

🔹 CLI Usage

ssl-analyzer example.com

🔹 Output in JSON Format

ssl-analyzer example.com --json

🔹 As a Python Module

You can also use it programmatically:

from ssl_analyzer import SSLAnalyzer

analyzer = SSLAnalyzer("example.com")
ssl_details = analyzer.analyze()
print(ssl_details)

📚 Example Output

🔹 Default CLI Output

SSL CERTIFICATE ANALYZER
========================

----------------------------------------
ISSUER
----------------------------------------
Common Name = DigiCert Global G3 TLS ECC SHA384 2020 CA1
Organization = DigiCert Inc
Country = US
State / Province = N/A
Locality = N/A

----------------------------------------
SUBJECT
----------------------------------------
Common Name = *.example.com
Organization = Internet Corporation for Assigned Names and Numbers
Country = US
State / Province = California
Locality = Los Angeles

----------------------------------------
SERIAL NUMBER
----------------------------------------
14416812407440461216471976375640436634

----------------------------------------
VERSION
----------------------------------------
v3

----------------------------------------
VALID FROM
----------------------------------------
2025-01-15T00:00:00+00:00

----------------------------------------
VALID UNTIL
----------------------------------------
2026-01-15T23:59:59+00:00

----------------------------------------
SIGNATURE ALGORITHM
----------------------------------------
sha384

----------------------------------------
SAN
----------------------------------------
*.example.com
example.com

----------------------------------------
PUBLIC KEY
----------------------------------------
Key Type = ECPublicKey
Key Size = 256
PEM Public Key = 
-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEmkiXhC1hbAjJahSgyDiA5gDAh/qZ
Vw4bAOLYh5JX5wj7PF6w04QoN8EkEY7TIHF0vZOPTgkDzgI7sORmc8+v7g==
-----END PUBLIC KEY-----

Curve = secp256r1
X Coordinate = 6978443739...
Y Coordinate = 1136371893...
Key Algorithm = Elliptic Curve (ECC)
Supported Key Uses = ['Digital Signature', 'Key Agreement']
Weak Key Check = Key appears strong

----------------------------------------
KEY USAGE
----------------------------------------
digital_signature = True
content_commitment = False
key_encipherment = False
data_encipherment = False
key_agreement = True
key_cert_sign = False
crl_sign = False
encipher_only = False
decipher_only = False


----------------------------------------
EXTENDED KEY USAGE
----------------------------------------
1.3.6.1.5.5.7.3.1
1.3.6.1.5.5.7.3.2

----------------------------------------
OCSP MUST-STAPLE
----------------------------------------
False

----------------------------------------
SELF-SIGNED
----------------------------------------
False

----------------------------------------
SHA-1 FINGERPRINT
----------------------------------------
N/A

----------------------------------------
SHA-256 FINGERPRINT
----------------------------------------
N/A

🔹 JSON Output

{
    "Issuer": {
        "Common Name": "DigiCert Global G3 TLS ECC SHA384 2020 CA1",
        "Organization": "DigiCert Inc",
        "Country": "US",
        "State / Province": "N/A",
        "Locality": "N/A"
    },
    "Subject": {
        "Common Name": "*.example.com",
        "Organization": "Internet Corporation for Assigned Names and Numbers",
        "Country": "US",
        "State / Province": "California",
        "Locality": "Los Angeles"
    },
    "Serial Number": 14416812407440461216471976375640436634,
    "Version": "v3",
    "Valid From": "2025-01-15T00:00:00+00:00",
    "Valid Until": "2026-01-15T23:59:59+00:00",
    "Signature Algorithm": "sha384",
    "SAN": [
        "*.example.com",
        "example.com"
    ],
    "Public Key": {
        "Key Type": "ECPublicKey",
        "Key Size": 256,
        "PEM Public Key": "\n-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEmkiXhC1hbAjJahSgyDiA5gDAh/qZ\nVw4bAOLYh5JX5wj7PF6w04QoN8EkEY7TIHF0vZOPTgkDzgI7sORmc8+v7g==\n-----END PUBLIC KEY-----\n",
        "Curve": "secp256r1",
        "X Coordinate": "6978443739...",
        "Y Coordinate": "1136371893...",
        "Key Algorithm": "Elliptic Curve (ECC)",
        "Supported Key Uses": [
            "Digital Signature",
            "Key Agreement"
        ],
        "Weak Key Check": "Key appears strong"
    },
    "Key Usage": {
        "digital_signature": true,
        "content_commitment": false,
        "key_encipherment": false,
        "data_encipherment": false,
        "key_agreement": true,
        "key_cert_sign": false,
        "crl_sign": false,
        "encipher_only": false,
        "decipher_only": false
    },
    "Extended Key Usage": [
        "1.3.6.1.5.5.7.3.1",
        "1.3.6.1.5.5.7.3.2"
    ],
    "OCSP Must-Staple": false,
    "Self-Signed": false,
    "SHA-1 Fingerprint": "N/A",
    "SHA-256 Fingerprint": "N/A"
}

🔹 Contribute

  • Open an issue for bugs/feature requests
  • Submit a pull request with improvements

💌 License

This project is licensed under the MIT License.


🔗 Links


This README.md ensures clarity, professionalism, and usability. Let me know if you want any modifications! 🚀

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_analyzer-0.1.4.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

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

ssl_analyzer-0.1.4-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file ssl_analyzer-0.1.4.tar.gz.

File metadata

  • Download URL: ssl_analyzer-0.1.4.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for ssl_analyzer-0.1.4.tar.gz
Algorithm Hash digest
SHA256 3a880ec244317728fa470c6391182a8288c2976307bb418cc711b2e25e01ee65
MD5 117618cda1600111aa175235332a3040
BLAKE2b-256 f6de5809009d59990f0752464f9f94b8b1514149d8d18d0d8062878b2e115a56

See more details on using hashes here.

File details

Details for the file ssl_analyzer-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: ssl_analyzer-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for ssl_analyzer-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a1b0b17974d72647e0fc1367a47b7ad1f42aed20be12b6d655784804408e6b24
MD5 7166812b018a08f8e7af9f254b6eb3af
BLAKE2b-256 764153aae1410cc9b8af63e27cffbba29209ada5c67ed281c4d75bc39674fedd

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