Skip to main content
Change of provenance

The repository or configuration that created this release differ from a previous release. View details.

Certbot DNS 阿里云 ESA 插件

通过阿里云边缘安全加速(ESA)API 自动创建 TXT 记录,完成 Certbot DNS-01 验证,申请及续期普通域名和泛域名证书。

本插件适用于 NS 接入 ESA 的域名,且 NS 委派须已生效;CNAME 接入仍需使用原 DNS 服务商的 Certbot 插件。参见 ESA DNS 接入方式。

功能特性

  • 自动分页查询站点,按 DNS 标签边界选择最长匹配项,无需手动填写站点 ID
  • 支持普通域名、子域名、泛域名及国际化域名
  • 支持多个挑战共用记录名,仅清理本次创建的记录,保留已有 TXT 记录
  • 支持 AccessKey 和 STS 临时凭证
  • 支持 Certbot 3、4、5 和 Python 3.9–3.15

Python 3.9 支持 Certbot 3/4,Python 3.10–3.13 支持 Certbot 3/4/5,Python 3.14–3.15 支持 Certbot 4/5。使用 Certbot 3 时需额外安装 pyopenssl<25。

安装

在实际运行 Certbot 的 Python 环境中,从源码安装:

pip install .
certbot plugins --text

输出应包含 dns-esa。使用 Certbot 3 时执行 pip install 'pyopenssl<25'。

配置文件

保存为 ~/esa.ini:

dns_esa_access_key_id = YOUR_ACCESS_KEY_ID
dns_esa_access_key_secret = YOUR_ACCESS_KEY_SECRET
# 可选,默认 cn-hangzhou;国际站可使用 ap-southeast-1
dns_esa_region_id = cn-hangzhou
# 可选,仅使用 STS 临时凭证时填写
# dns_esa_security_token = YOUR_SECURITY_TOKEN

region_id 应与站点所在的 API 地域一致。插件只查询所选地域,不会跨地域猜测。支持的公网接入点为杭州和新加坡,参见 ESA 服务接入点。使用 STS 时,续期前需确保凭证仍有效。

限制凭证文件权限:

chmod 600 ~/esa.ini

Windows 用户请通过系统文件权限限制访问。

运行

certbot certonly \
  --authenticator dns-esa \
  --dns-esa-credentials ~/esa.ini \
  --dns-esa-propagation-seconds 30 \
  -d '*.example.com' \
  -d example.com

DNS 传播等待默认 30 秒,可根据实际情况增加。TXT TTL 默认 600 秒,可通过 --dns-esa-ttl 调整;1 表示 ESA 自动 TTL,其余允许值取决于服务限制。创建记录超时后插件不会自动重试写入,以避免重复创建。

后续使用 certbot renew 自动续期。可先使用 certbot renew --dry-run 检查续期配置。

阿里云权限配置

AccessKey 需具备 AliyunESAFullAccess,或包含以下操作的自定义 RAM 权限:

{
  "Version": "1",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "esa:ListSites",
        "esa:ListRecords",
        "esa:CreateRecord",
        "esa:DeleteRecord"
      ],
      "Resource": "*"
    }
  ]
}

ListSites 和 DeleteRecord 需要 Resource: "*";ListRecords 和 CreateRecord 可进一步限制到指定站点。参见 ListSites、ListRecords、CreateRecord、DeleteRecord。

自动部署

本项目只负责 Certbot DNS 验证;申请后的自动部署可配合 AutoCert。

Metadata

Release files for certbot-dns-esa 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Change of provenance

The repository or configuration that created these release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Source distribution (sdist)

Source distribution for certbot-dns-esa 1.0.1
File Size Uploaded Provenance Actions
certbot_dns_esa-1.0.1.tar.gz 281.7 kB With provenance Details for certbot_dns_esa-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for certbot-dns-esa 1.0.1
File Interpreter ABI Platform Actions
certbot_dns_esa-1.0.1-py3-none-any.whl Python 3 none any Details for certbot_dns_esa-1.0.1-py3-none-any.whl

Total release size: 291.8 kB

Release files / certbot_dns_esa-1.0.1.tar.gz

Change of provenance

This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Download URL certbot_dns_esa-1.0.1.tar.gz
Size 281.7 kB
Tags Source
SHA-256 checksum
How to use checksums
12babf4c9e008402973394b10094839dc697b5f2c535d64ee39b8332f4f94a5a
BLAKE2b-256 checksum
How to use checksums
f5d4d5af3fe24977b002a6c6865a2ceb5cedde8034d621bf07e7f0c18958e0dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 27, 2026.

Transparency log

Release files / certbot_dns_esa-1.0.1-py3-none-any.whl

Change of provenance

This file belongs to a release with changed provenance: the repository or configuration that created the release files differ from that of a previous release.

We recommend inspecting the repository and configuration before proceeding. View details.

Download URL certbot_dns_esa-1.0.1-py3-none-any.whl
Size 10.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4ea7152b323c89fe0e2c82d289df8597c5d6cd46627b1bb35d2af29964a115dc
BLAKE2b-256 checksum
How to use checksums
011f4d661ec0a8948c4214071e8e251b029562f1bf725ade60244d7eeec5f317
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 27, 2026.

Transparency log

Security for certbot-dns-esa 1.0.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.

Change of provenance

The repository and configuration that created this release differ from a previous release.

While this could reflect a routine change by the project maintainers, it may also indicate that the release files have been compromised.

Select from 2 files

Attestation for certbot_dns_esa-1.0.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 Oct 27, 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.

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