Skip to main content

Project to help use the breadcrumbs that are left by the certificate to build the chain and output it into files.

Project description

Get Certificate Chain 🌐🔐

This Python script retrieves the certificate chain from a website, allowing you to analyze and verify the SSL/TLS certificates of the website. The original source can be found here, and the overwhelming majority of credit goes to TheScriptGuy.

This repository will operate as a custom fork of that project to act as a customized plugin for the PAN Dashboard project, allowing users to retrieve the certificate chain of a website from within the PAN Dashboard and have it uploaded to a PAN-OS or Panorama appliance.

Table of Contents

Requirements 📋

Creating Virtual Environment with Poetry 🌱

To create a virtual environment with Poetry, follow these steps:

  1. Install Poetry if you haven't already:

    curl -sSL https://install.python-poetry.org | python3 -
    
  2. Create a virtual environment:

    poetry install
    
  3. Activate the virtual environment:

    poetry shell
    

Creating Virtual Environment without Poetry 🌱

To create a virtual environment without Poetry, follow these steps:

  1. Create a virtual environment:

    python3 -m venv venv
    
  2. Activate the virtual environment:

    source venv/bin/activate
    
  3. Install the required packages:

    pip install cryptography argparse pytest
    

Usage 🚀

To use the script, run the following command:

python get_certificate_chain.py --domain www.google.com

Arguments

  • --domain: The domain:port pair that the script should connect to. Defaults to www.google.com:443.
  • --rm-ca-files: Remove the certificate files in the current working directory (*.crt, *.pem).
  • --get-ca-cert-pem: Get cacert.pem from the curl.se website to help find Root CA.

Examples

Get the certificate chain for www.example.com:

python get_certificate_chain.py --domain www.example.com

Get the certificate chain for www.example.com:8443:

python get_certificate_chain.py --domain www.example.com:8443

Get the certificate chain for www.example.com:8443 and remove the certificate files in the current working directory (*.crt, *.pem):

python get_certificate_chain.py --domain www.example.com:8443 --rm-ca-files

Get the certificate chain for www.example.com:8443 and get cacert.pem from the curl.se website to help find Root CA:

python get_certificate_chain.py --domain www.example.com:8443 --get-ca-cert-pem

Get the certificate chain for www.example.com:8443, remove the certificate files in the current working directory (*.crt, *.pem), and get cacert.pem from the curl.se website to help find Root CA:

python get_certificate_chain.py --domain www.example.com:8443 --rm-ca-files --get-ca-cert-pem

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

get_certificate_chain-0.1.0.tar.gz (6.4 kB view hashes)

Uploaded Source

Built Distribution

get_certificate_chain-0.1.0-py3-none-any.whl (6.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page