get-certificate-chain


Nameget-certificate-chain JSON
Version 0.1.7 PyPI version JSON
download
home_page
SummaryProject to help use the breadcrumbs that are left by the certificate to build the chain and output it into files.
upload_time2023-04-19 16:46:31
maintainer
docs_urlNone
authorCalvin Remsburg
requires_python>=3.9,<4.0
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Get Certificate Chain 🌐🔐

[![PyTests](https://github.com/cdot65/get_certificate_chain/actions/workflows/tests.yml/badge.svg)](https://github.com/cdot65/get_certificate_chain/actions/workflows/tests.yml)

This Python script retrieves the certificate chain from a website, allowing you to analyze and verify the SSL/TLS certificates of the website. This project is a custom fork of the [getCertificateChain project](https://github.com/TheScriptGuy/getCertificateChain), and the overwhelming majority of credit goes to [TheScriptGuy](https://github.com/TheScriptGuy).

## Table of Contents

- [Get Certificate Chain 🌐🔐](#get-certificate-chain-)
  - [Table of Contents](#table-of-contents)
  - [Requirements 📋](#requirements-)
  - [Installation](#installation)
    - [PyPi](#pypi)
    - [GitHub](#github)
  - [Usage 🚀](#usage-)
    - [Import into script](#import-into-script)
    - [Command Line CLI](#command-line-cli)
      - [Arguments](#arguments)
  - [Contributing](#contributing)
  - [License](#license)

## Requirements 📋

- Python 3.9+
- Poetry (optional) - [Python Poetry](https://python-poetry.org/docs/)

## Installation

### PyPi

To install the package from PyPi, simply run the appropriate command.

```bash
pip install get-certificate-chain
```

### GitHub

To install from the GitHub repository, follow these steps:

1. Clone the repository.
2. Change the directory to the cloned repository.
3. Install the package using pip.

```bash
git clone https://github.com/cdot65/get_certificate_chain.git
cd get_certificate_chain
pip install .
```

## Usage 🚀

### Import into script

To use the package in your script, simply import the package and create an instance of the `SSLCertificateChainDownloader` object.

To pass arguments into the object, you can use the `argparse` library:

1. Import the argparse library.
2. Import the SSLCertificateChainDownloader object from the package.
3. Create a python dictionary with the "host" key and value of the domain.
4. Create an instance of the SSLCertificateChainDownloader object.
5. Run the downloader object with the parsed arguments.

```python
from get_certificate_chain.download import SSLCertificateChainDownloader

downloader = SSLCertificateChainDownloader()
# Use the downloader object for your needs
```

You can pass the arguments directly into the object:

```python
from get_certificate_chain.download import SSLCertificateChainDownloader

downloader = SSLCertificateChainDownloader()
downloader.run({'host': 'www.google.com'})
```

![import](images/import.png)

Or pass you can use the `argparse` library to parse the arguments:

```python
import argparse
from get_certificate_chain.download import SSLCertificateChainDownloader

# Add your arguments
args = parser.parse_args()

downloader = SSLCertificateChainDownloader()
downloader.run(args)
```

You may also specify an output directory when creating an instance of the class:

```python
from get_certificate_chain.download import SSLCertificateChainDownloader

downloader = SSLCertificateChainDownloader(output_directory="/var/tmp")
downloader.run({"host": "www.google.com"})
```

### Command Line CLI

To use the script from the command line, run the following command:

```bash
get-certificate-chain --host www.google.com
```

![cli](images/cli.png)

```bash
get-certificate-chain --rm-ca-files
```

![cli](images/rm.png)

#### Arguments

- `--host`: The host: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 chost.se website to help find Root CA.
- `--log-level`: Set the log level. Defaults to INFO.
- `--output-dir`: Set the output directory. Defaults to the current working directory.

## Contributing

Contributions are welcome! To contribute, please follow these guidelines:

1. Write tests for your code using `pytest`. Make sure your tests follow the standards set by the existing tests.
2. Set up a virtual environment using `Poetry`. You can install Poetry by following the instructions at https://python-poetry.org/docs/#installation.

To set up a new virtual environment for the project, run the appropriate command.

```bash
poetry install
```

To activate the virtual environment, run the appropriate command.

```bash
poetry shell
```

After making your changes and adding tests, ensure that all tests pass by running the appropriate command.

```bash
pytest
```

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "get-certificate-chain",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "Calvin Remsburg",
    "author_email": "cremsburg.dev@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/7c/d6/b2b1e3ee07c4e91990d68f8c55194f6907b7f5a063d991f1cd99cbd9130b/get_certificate_chain-0.1.7.tar.gz",
    "platform": null,
    "description": "# Get Certificate Chain \ud83c\udf10\ud83d\udd10\n\n[![PyTests](https://github.com/cdot65/get_certificate_chain/actions/workflows/tests.yml/badge.svg)](https://github.com/cdot65/get_certificate_chain/actions/workflows/tests.yml)\n\nThis Python script retrieves the certificate chain from a website, allowing you to analyze and verify the SSL/TLS certificates of the website. This project is a custom fork of the [getCertificateChain project](https://github.com/TheScriptGuy/getCertificateChain), and the overwhelming majority of credit goes to [TheScriptGuy](https://github.com/TheScriptGuy).\n\n## Table of Contents\n\n- [Get Certificate Chain \ud83c\udf10\ud83d\udd10](#get-certificate-chain-)\n  - [Table of Contents](#table-of-contents)\n  - [Requirements \ud83d\udccb](#requirements-)\n  - [Installation](#installation)\n    - [PyPi](#pypi)\n    - [GitHub](#github)\n  - [Usage \ud83d\ude80](#usage-)\n    - [Import into script](#import-into-script)\n    - [Command Line CLI](#command-line-cli)\n      - [Arguments](#arguments)\n  - [Contributing](#contributing)\n  - [License](#license)\n\n## Requirements \ud83d\udccb\n\n- Python 3.9+\n- Poetry (optional) - [Python Poetry](https://python-poetry.org/docs/)\n\n## Installation\n\n### PyPi\n\nTo install the package from PyPi, simply run the appropriate command.\n\n```bash\npip install get-certificate-chain\n```\n\n### GitHub\n\nTo install from the GitHub repository, follow these steps:\n\n1. Clone the repository.\n2. Change the directory to the cloned repository.\n3. Install the package using pip.\n\n```bash\ngit clone https://github.com/cdot65/get_certificate_chain.git\ncd get_certificate_chain\npip install .\n```\n\n## Usage \ud83d\ude80\n\n### Import into script\n\nTo use the package in your script, simply import the package and create an instance of the `SSLCertificateChainDownloader` object.\n\nTo pass arguments into the object, you can use the `argparse` library:\n\n1. Import the argparse library.\n2. Import the SSLCertificateChainDownloader object from the package.\n3. Create a python dictionary with the \"host\" key and value of the domain.\n4. Create an instance of the SSLCertificateChainDownloader object.\n5. Run the downloader object with the parsed arguments.\n\n```python\nfrom get_certificate_chain.download import SSLCertificateChainDownloader\n\ndownloader = SSLCertificateChainDownloader()\n# Use the downloader object for your needs\n```\n\nYou can pass the arguments directly into the object:\n\n```python\nfrom get_certificate_chain.download import SSLCertificateChainDownloader\n\ndownloader = SSLCertificateChainDownloader()\ndownloader.run({'host': 'www.google.com'})\n```\n\n![import](images/import.png)\n\nOr pass you can use the `argparse` library to parse the arguments:\n\n```python\nimport argparse\nfrom get_certificate_chain.download import SSLCertificateChainDownloader\n\n# Add your arguments\nargs = parser.parse_args()\n\ndownloader = SSLCertificateChainDownloader()\ndownloader.run(args)\n```\n\nYou may also specify an output directory when creating an instance of the class:\n\n```python\nfrom get_certificate_chain.download import SSLCertificateChainDownloader\n\ndownloader = SSLCertificateChainDownloader(output_directory=\"/var/tmp\")\ndownloader.run({\"host\": \"www.google.com\"})\n```\n\n### Command Line CLI\n\nTo use the script from the command line, run the following command:\n\n```bash\nget-certificate-chain --host www.google.com\n```\n\n![cli](images/cli.png)\n\n```bash\nget-certificate-chain --rm-ca-files\n```\n\n![cli](images/rm.png)\n\n#### Arguments\n\n- `--host`: The host:port pair that the script should connect to. Defaults to www.google.com:443.\n- `--rm-ca-files`: Remove the certificate files in the current working directory (`*.crt`, `*.pem`).\n- `--get-ca-cert-pem`: Get cacert.pem from the chost.se website to help find Root CA.\n- `--log-level`: Set the log level. Defaults to INFO.\n- `--output-dir`: Set the output directory. Defaults to the current working directory.\n\n## Contributing\n\nContributions are welcome! To contribute, please follow these guidelines:\n\n1. Write tests for your code using `pytest`. Make sure your tests follow the standards set by the existing tests.\n2. Set up a virtual environment using `Poetry`. You can install Poetry by following the instructions at https://python-poetry.org/docs/#installation.\n\nTo set up a new virtual environment for the project, run the appropriate command.\n\n```bash\npoetry install\n```\n\nTo activate the virtual environment, run the appropriate command.\n\n```bash\npoetry shell\n```\n\nAfter making your changes and adding tests, ensure that all tests pass by running the appropriate command.\n\n```bash\npytest\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Project to help use the breadcrumbs that are left by the certificate to build the chain and output it into files.",
    "version": "0.1.7",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0d64333e1d73ef8dd0dbc747c3082be3604dd19ea22b2ee2097f4719f20152d1",
                "md5": "5346503796c262c0a39051b8f44418bd",
                "sha256": "2a2ed95fda237652b5aa2d7f0d2ff11abf6fdaed9936aa8e48e387d4a4690d46"
            },
            "downloads": -1,
            "filename": "get_certificate_chain-0.1.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5346503796c262c0a39051b8f44418bd",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9,<4.0",
            "size": 11327,
            "upload_time": "2023-04-19T16:46:29",
            "upload_time_iso_8601": "2023-04-19T16:46:29.240147Z",
            "url": "https://files.pythonhosted.org/packages/0d/64/333e1d73ef8dd0dbc747c3082be3604dd19ea22b2ee2097f4719f20152d1/get_certificate_chain-0.1.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7cd6b2b1e3ee07c4e91990d68f8c55194f6907b7f5a063d991f1cd99cbd9130b",
                "md5": "5b0bca2547b975e521b65cf486c5cf2e",
                "sha256": "c0c5bb4e00b26a1db9816dd058bb0d38a0bb54389ff7fbbd151280968104aa6e"
            },
            "downloads": -1,
            "filename": "get_certificate_chain-0.1.7.tar.gz",
            "has_sig": false,
            "md5_digest": "5b0bca2547b975e521b65cf486c5cf2e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9,<4.0",
            "size": 10617,
            "upload_time": "2023-04-19T16:46:31",
            "upload_time_iso_8601": "2023-04-19T16:46:31.670578Z",
            "url": "https://files.pythonhosted.org/packages/7c/d6/b2b1e3ee07c4e91990d68f8c55194f6907b7f5a063d991f1cd99cbd9130b/get_certificate_chain-0.1.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-19 16:46:31",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "get-certificate-chain"
}
        
Elapsed time: 0.07856s