certbot-dns-aliyun-esa
Aliyun ESA DNS authenticator plugin for Certbot. It creates and removes Aliyun ESA DNS TXT records for ACME dns-01 challenges, including wildcard certificates.
This project is community-maintained and is not an official Aliyun or Certbot plugin.
中文文档:见 README.zh-CN.md。
Features
- Certbot Authenticator-only plugin for
dns-01validation. - Supports wildcard certificates, for example
*.example.com. - Uses Aliyun ESA
CreateRecord,ListRecords,DeleteRecord, andListSitesAPIs. - Deletes TXT records by matching record name, record type, and TXT value to avoid removing unrelated records.
- Supports multiple TXT values under the same
_acme-challengename.
Installation
From PyPI
pip install certbot-dns-aliyun-esa
From source
git clone https://github.com/lampofaladdin/certbot-dns-aliyun-esa.git
cd certbot-dns-aliyun-esa
python3 -m venv .venv
. .venv/bin/activate
pip install -e .
Verify that Certbot can discover the plugin:
certbot plugins
You should see dns-aliyun-esa in the plugin list.
Credentials
Create an INI file, for example /etc/letsencrypt/aliyun-esa.ini:
dns_aliyun_esa_access_key_id = your-access-key-id
dns_aliyun_esa_access_key_secret = your-access-key-secret
Protect the file:
chmod 600 /etc/letsencrypt/aliyun-esa.ini
The AccessKey needs permissions to:
- list ESA sites;
- create DNS records;
- list DNS records;
- delete DNS records.
Usage
Issue a certificate:
certbot certonly \
--authenticator dns-aliyun-esa \
--dns-aliyun-esa-credentials /etc/letsencrypt/aliyun-esa.ini \
--dns-aliyun-esa-propagation-seconds 60 \
-d example.com \
-d '*.example.com'
Use staging first when testing automation:
certbot certonly \
--test-cert \
--authenticator dns-aliyun-esa \
--dns-aliyun-esa-credentials /etc/letsencrypt/aliyun-esa.ini \
--dns-aliyun-esa-propagation-seconds 60 \
-d example.com \
-d '*.example.com'
Plugin options
| Option | Default | Description |
|---|---|---|
--dns-aliyun-esa-credentials |
required | Path to the credentials INI file. |
--dns-aliyun-esa-propagation-seconds |
60 |
Seconds to wait before ACME validation. Increase this if DNS propagation is slow. |
--dns-aliyun-esa-region-id |
cn-hangzhou |
Aliyun ESA region ID. |
--dns-aliyun-esa-endpoint |
esa.cn-hangzhou.aliyuncs.com |
Aliyun ESA API endpoint passed to the official SDK. Override it if your environment needs another regional endpoint. |
--dns-aliyun-esa-ttl |
1 |
TTL for created TXT records. 1 follows ESA default TTL behavior from Aliyun's generated sample. |
How it works
Certbot calls the plugin with a validation name such as _acme-challenge.example.com and a TXT value. The plugin then:
- lists Aliyun ESA sites;
- matches the requested domain to the best ESA site name;
- creates a TXT record using ESA
CreateRecord; - waits for DNS propagation through Certbot's DNS plugin flow;
- finds the exact TXT record by record name, type, and value;
- deletes only that matching TXT record.
Development
Install development dependencies:
python3 -m venv .venv
. .venv/bin/activate
pip install -e '.[test]'
Run tests:
pytest
Run a basic plugin discovery check:
certbot plugins | grep -A 5 dns-aliyun-esa
Build and check the package locally:
python -m pip install --upgrade build twine
rm -rf dist build *.egg-info src/*.egg-info
python -m build
python -m twine check dist/*
Publishing
This repository includes GitHub Actions workflows for CI and PyPI publishing:
- .github/workflows/ci.yml runs tests, plugin discovery, package build, and metadata checks.
- .github/workflows/publish.yml publishes to PyPI when a GitHub Release is published.
Publishing uses PyPI Trusted Publishing, so no PyPI API token needs to be stored in GitHub secrets.
Configure PyPI Trusted Publishing
In the PyPI project settings for certbot-dns-aliyun-esa, add a pending trusted publisher with:
| Field | Value |
|---|---|
| Owner | lampofaladdin |
| Repository name | certbot-dns-aliyun-esa |
| Workflow name | publish.yml |
| Environment name | pypi |
Release a version
- Update
versionin pyproject.toml. - Update CHANGELOG.md.
- Commit and push the change to
main. - Create and push a matching tag, for example
v0.1.1. - Create a GitHub Release from that tag.
- Publishing the GitHub Release triggers the PyPI workflow.
Security notes
- Do not commit credentials files.
- Restrict credential file permissions to
0600. - Prefer least-privilege RAM users/roles for the Aliyun AccessKey.
- Test with
--test-certbefore requesting production certificates.
License
Apache License 2.0. See LICENSE.
Metadata
Release files for certbot-dns-aliyun-esa 0.1.1
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 |
|---|---|---|---|---|
| certbot_dns_aliyun_esa-0.1.1.tar.gz | 13.6 kB | With provenance | Details for certbot_dns_aliyun_esa-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| certbot_dns_aliyun_esa-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for certbot_dns_aliyun_esa-0.1.1-py3-none-any.whl |
Total release size: 25.5 kB
Release files / certbot_dns_aliyun_esa-0.1.1.tar.gz
| Download URL | certbot_dns_aliyun_esa-0.1.1.tar.gz |
|---|---|
| Size | 13.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
68b850ceeb2327576874b320f274ecf37037d03eb1fca1dbf8d4dda031ffde75
|
|
BLAKE2b-256 checksum How to use checksums |
4238dfe98823554efa5f2fc958a21e4836f04ca59f881f2aebd25784f47478cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 6, 2026.
Transparency logRelease files / certbot_dns_aliyun_esa-0.1.1-py3-none-any.whl
| Download URL | certbot_dns_aliyun_esa-0.1.1-py3-none-any.whl |
|---|---|
| Size | 11.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ebc78ebb328963146673f6139e0de75126e7e539e872f2bbe5d37ecd626303db
|
|
BLAKE2b-256 checksum How to use checksums |
75f5d46051590d4815c6458ec2f216b7640c4254384839dbf97400651a13a296
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 6, 2026.
Transparency logSecurity for certbot-dns-aliyun-esa 0.1.1
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for certbot_dns_aliyun_esa-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 6, 2026.
Transparency logA 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.