Skip to main content

certbot-dns-aliyun-esa

Python Certbot License

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-01 validation.
  • Supports wildcard certificates, for example *.example.com.
  • Uses Aliyun ESA CreateRecord, ListRecords, DeleteRecord, and ListSites APIs.
  • 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-challenge name.

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:

  1. lists Aliyun ESA sites;
  2. matches the requested domain to the best ESA site name;
  3. creates a TXT record using ESA CreateRecord;
  4. waits for DNS propagation through Certbot's DNS plugin flow;
  5. finds the exact TXT record by record name, type, and value;
  6. 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:

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

  1. Update version in pyproject.toml.
  2. Update CHANGELOG.md.
  3. Commit and push the change to main.
  4. Create and push a matching tag, for example v0.1.1.
  5. Create a GitHub Release from that tag.
  6. 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-cert before 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)

Source distribution for certbot-dns-aliyun-esa 0.1.1
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)

Table of built distributions (wheels) for certbot-dns-aliyun-esa 0.1.1
File Interpreter ABI Platform Actions
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 log

Release 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 log

Security 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.

Select from 2 files

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 log

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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page