CertBot 泛域名签证-续订 Nginx CentOs7环境

558°C 24-11-2018
最近更新于:2022-06-16 18:42:47

文章摘要chatGPT

standby chatGPT responsing..

CertBot 泛域名签证-续订 Nginx CentOs7环境

2018年3月13日,Let’s Encrypt 终于在社区宣布支持通配符证书,但是泛域名有以下限制: 无法通过webroot方式签证,必须使用dns的方式。 certbot提供了多个第三方的插件,但是没有国内的DNS服务商插… 主域名+泛域名 certbot certonly -d *.2broear.com -d 2broear.com –manual –preferred-challenges dns –server https://acme-v02.api.letsencrypt.org/directory…

Lets Encrypt 泛域名签证

sudo certbot certonly --webroot -w /usr/share/nginx/html/ -d yourdomain.com

主域名+泛域名

certbot certonly -d *.2broear.com -d 2broear.com --manual --preferred-challenges dns --server https://acme-v02.api.letsencrypt.org/directory
开始日期过期日期备注
2018
11/23/201802/21/2019第一次使用 lets encrypt 泛域名签证
TXT_acme-challengeP-QYovRt-RzdyrdNzU8fmEHaSeqxJh47gev_W_IQpfk
2019
02/11/201905/12/201919年续订 lets encrypt 泛域名签证
TXT_acme-challenge.2broear.comEkDNKZdzr_USDzDCwLZObo36OCN1MJt6N_sDGIzd1lw
slideToggle

使用 Let’s encrypt 官方提供的 Certbot 进行 泛域名签证-续约

2018年3月13日,Let’s Encrypt 终于在社区宣布支持通配符证书,但是泛域名有以下限制:

  • 无法通过webroot方式签证,必须使用dns的方式。
  • certbot提供了多个第三方的插件,但是没有国内的DNS服务商插件
  • 依然限制90天的有效期

泛域名证书中,.abc.com可以使用同一张证书,但是 123.*.abc.com就不能和 .abc.com使用同一张证书了,我们现在大量使用三级四级域名,所以这种泛域名的签证方式并不适合我们(需要手动更新,维护工作量巨大)

泛域名签证使用的是ACME V2版本的协议,certbot0.22.0以上的版本支持新的协议,所以我们要先检查一下certbot的版本是否达到需求:

[root@OPS ~]# certbot --version

使用以下命令即可签发泛域名证书:

[root@OPS ~] certbot certonly -d *.abc.com --manual --preferred-challenges dns --server https://acme-v02.api.letsencrypt.org/directory

certonly表示只签证
-d 指定了需要签证的域名
–manual 指定了以手工交互模式签证
–preferred-challenges dns 指定了通过DNS挑战来验证
–server 指定acme的服务器

回车之后会有一系列的交互信息需要填写,例如email地址、是否同意协议等
整个过程最重要的是你会看到如下信息:

---------------------------------------------
  Please deploy a DNS TXT record under the name
  
  _acme-challenge.abc.com with the following value:
  
  9L2_ihN6Y8AefoXbTBFN7n9ydVa4k5fF3z1qT5Zi6qE
  
  Before continuing, verify the record is deployed
  ---------------------------------------------
  
  Press Enter to Continue

看到以上信息的时候不要做任何操作,你需要到你的域名DNS解析增加一条如下解析:
记录类型 主机记录 解析线路 记录值 TXT _acme-challenge 默认 9L2_ihN6Y8AefoXbTBFN7n9ydVa4k5fF3z1
qT5Zi6qE

解析之后等待生效。

Let’s Encrypt官网

Let’s Encrypt is a free, automated, and open Certificate Authority.
https://letsencrypt.org/


评论留言

既来之则留之~ 欢迎在下方留言评论,提交评论后还可以撤销或重新编辑。(Valine 会自动保存您的评论信息到浏览器)