Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

blog/cname/ #8

giscus[bot] Bot started this conversation in Comments
Jun 28, 2025 · 1 comment
Discussion options

blog/cname/

Certimate 使用 DNS-01 质询验证你的域名的所有权,截至本文发布时已支持 20+ 域名托管商。但是仍有用户持有的域名不在支持的范围内,或者想给客户申请证书但是域名不在自己的掌控范围内。

https://docs.certimate.me/blog/cname/

You must be logged in to vote

Replies: 1 comment

Comment options

对于申请泛域名证书 *.a.com;a.com

_acme-challenge.a.com CNAME a.com.validationserver.b.com 这样不行

_acme-challenge.a.com CNAME _acme-challenge.validationserver.b.com 这样才可以。


实施细节

我的要求:既能申请各种域名证书,又最小化暴露dns-01验证所要求的域名控制权。这里只需要使用一个注册的域名。

原理解析:

  1. 如果你的要获取证书的域名 a.com 在DNSPod,为你的任意子域,如 acme.a.com 添加NS记录托管到阿里云解析。这里通过NS服务商来物理上划分权限。
  2. 添加CNAME _acme-challenge.a.com ---> _acme-challenge.acme.a.com,为下一步传递TXT记录做准备。
  3. 我把 acme.a.com 作为承担所有dns-01验证任务的专用域名。由于这个域名托管在阿里云,所以无论怎样操作、密钥泄露都不会影响到dnspod上的主域名记录。
  4. 给阿里云上的RAM子用户提供有限的操作权、可以实现按资源组授权来实现最小化授权。
alidns:DescribeDomains (唯独这个操作不支持区分资源组,只能全局授权,可以查到阿里云解析账户上托管的所有域名)
alidns:DescribeDomainRecords 
alidns:AddDomainRecord
alidns:UpdateDomainRecord
alidns:DeleteDomainRecord
  1. 在 Certimate 上配置工作流,授权选阿里云。go-acme/lego会自己查到cname记录,并在_acme-challenge.acme 上添加解析,完成验证。
You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /