SSL Renewal Client Library
A lightweight Python library designed to integrate with the SSL Auto-Renewal Service API.
This library allows any Python application to:
- Automatically monitor SSL certificates
- Validate their status against a central service
- Download and update certificates automatically if they have been renewed
Installation
pip install ssl-renewal-client
Quick Start
1. Automatic Monitoring (Recommended)
The easiest way is to start the monitor in the background when your application starts.
from ssl_renewal_client import SSLMonitor
import os
def reload_web_server():
"""
Callback that executes when certificates are updated.
Here you can restart your web server (Nginx, Gunicorn, etc).
"""
print("Certificates updated! Reloading server...")
# Example: os.system("systemctl reload nginx")
# Configuration
monitor = SSLMonitor(
api_url="http://your-ssl-api.com",
domains=["yourdomain.com"],
cert_dir="/etc/letsencrypt/live", # Where to save certificates
check_interval_hours=12,
on_update_callback=reload_web_server
)
# Start in background (doesn't block your app)
monitor.start(block=False)
# ... Your application continues running here ...
2. Manual Usage (API Client)
If you prefer full control over when to check:
from ssl_renewal_client import SSLAPIClient, CertificateManager
client = SSLAPIClient("http://your-ssl-api.com")
manager = CertificateManager("/etc/letsencrypt/live")
domain = "yourdomain.com"
# 1. Validate and renew if necessary
result = client.validate_certificate(domain, auto_renew=True)
if result.get("action") == "renewed":
# 2. Download files
files_data = client.get_certificate_files(domain)
# 3. Save to disk
manager.update_certificates(domain, files_data["files"])
print("Certificates renewed and downloaded.")
else:
print("Certificate valid, no action required.")
Generated File Structure
The library will save certificates in the specified directory (cert_dir) with the following structure:
/etc/letsencrypt/live/
└── yourdomain.com/
├── fullchain.pem
├── privkey.pem
├── cert.pem
└── chain.pem
Requirements
- Python 3.7+
requests>=2.25.0
Features
- ✅ Automatic certificate monitoring
- ✅ Background thread execution (non-blocking)
- ✅ Automatic certificate download on renewal
- ✅ Callback support for service reload
- ✅ Lightweight and easy to integrate
- ✅ Thread-safe operations
License
MIT License
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Metadata
Release files for ssl-renewal-client 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ssl_renewal_client-0.1.0.tar.gz | 7.7 kB | Without provenance | Details for ssl_renewal_client-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ssl_renewal_client-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for ssl_renewal_client-0.1.0-py3-none-any.whl |
Total release size: 15.3 kB
Release files / ssl_renewal_client-0.1.0.tar.gz
| Download URL | ssl_renewal_client-0.1.0.tar.gz |
|---|---|
| Size | 7.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
764eca121cee808bb831955c5fba0d16334fd0510bd5307c35f5ee93a589bcb9
|
|
BLAKE2b-256 checksum How to use checksums |
da300854ad2086e635bf076111189d7c3268dd1236f5294ba9297590e55870b2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.2
|
Release files / ssl_renewal_client-0.1.0-py3-none-any.whl
| Download URL | ssl_renewal_client-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3c08ce721eeac258356a01f8d00e93303ce2bb81b2f263838dec07d3fd4c8c5e
|
|
BLAKE2b-256 checksum How to use checksums |
bc0263fab482965a50cd8981113685d87a7ec91abededbb2793c3a099d370918
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.2
|
Security for ssl-renewal-client 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.