Skip to main content

Python Package for managing keys, request SSL certificates from ACME.

Project description

CertApi

Certapi talks with DNS provider and ACME to issue SSL certificates and save it to a keystore.

CertApi is a base library for building other tools, or to integrate Certificate creation feature in your app. CertAPI also provides HTTP api server and can be deployed using Docker

Build Status codecov PyPI version

Why another library?

I designed this library so that it can be imported and plugged in to other python projects. Goal is not to provide CLIs or quick working demo, but to be versatile for any use case.

  • Pluggable keystores for keys and certificates
  • Pluggable Challenge solvers for DNS and Http challenge solving
  • High-level manager with renewal checks and multi-solver support
  • Same interface for working locally, or requesting certificate from certapi server.

See the developer guide in Developer.md for library usage and workflows.

Installation

You can install CertApi using pip

pip install certapi

CLI

CertApi also ships with a CLI for quick verification and certificate issuance.

## Certapi's dependencies are already included in the python installation. This doesn't affect the system.
sudo python3 -m pip install certapi --break-system-packages

1. With HTTP Challenge

HTTP challenge requires you to have seup the DNS correctly. The ACME server will verify your domain by making an HTTP request.

# Verify environment and HTTP routing
sudo certapi verify example.com www.example.com

# Obtain a certificate (requires root for HTTP-01)
sudo certapi obtain example.com www.example.com

2. With DNS Provider Key

Using DNS-01 challenge with Cloudflare doesn't require the DNS to be setup. Set your Cloudflare API key as an environment variable.

# Set Cloudflare API key or token
export CLOUDFLARE_API_KEY=...   # or CLOUDFLARE_API_TOKEN

# Verify DNS configuration
sudo certapi verify example.com

# Obtain a certificate using DNS-01
sudo certapi obtain example.com www.example.com

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

certapi-1.1.12.tar.gz (67.1 kB view details)

Uploaded Source

Built Distribution

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

certapi-1.1.12-py3-none-any.whl (62.4 kB view details)

Uploaded Python 3

File details

Details for the file certapi-1.1.12.tar.gz.

File metadata

  • Download URL: certapi-1.1.12.tar.gz
  • Upload date:
  • Size: 67.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for certapi-1.1.12.tar.gz
Algorithm Hash digest
SHA256 0002f5c7243a22d9a706638ac06239bc1b30e5577a8b4cae5f80ad207649db11
MD5 79acab9d58c52c45096dd1e2b5a032e3
BLAKE2b-256 5ee4f3533a685cff27de9e0cad4fe2977b92f00679e75d66d09052b44360ad42

See more details on using hashes here.

File details

Details for the file certapi-1.1.12-py3-none-any.whl.

File metadata

  • Download URL: certapi-1.1.12-py3-none-any.whl
  • Upload date:
  • Size: 62.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for certapi-1.1.12-py3-none-any.whl
Algorithm Hash digest
SHA256 4c8acccd79ffda27b08f9faf02adc82e6e22e5a62a15d0bde041daa7c515d0d8
MD5 85c8daaf98c0f473150ce739a3f51399
BLAKE2b-256 a5a1beab7b7d5121490b9090b3697a435270ae8b4919a9b5ae1715ee572068a5

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