Letsencrypt Wildcard Let's Encrypt:使用 Certbot 的通配符证书

2025-06-07

Letsencrypt Wildcard Let's Encrypt:使用 Certbot 的通配符证书

* 封面图片最初由OpenClipart-Vectors制作,并经过精心编辑。


介绍

Let's Encrypt已于2018 年 3 月 13 日开始支持使用DNS-01 挑战的 ACMEv2通配符证书其客户端Certbot提供了执行该操作的选项 我对此表示衷心的感谢。
--manual

我写了如何使用 Certbot 生成通配符证书。
这是一个非常简单的任务 :)
只需在 DNS 服务器中添加一条 Certbot 指定的 TXT 记录即可。

* 注意:由于需要每 90 天更新一次 Let's Encrypt 的证书因此每次更新时都需要新的 TXT 记录

身体

环境

教程

命令如下:

# certbot certonly --manual --preferred-challenges dns --server https://acme-v02.api.letsencrypt.org/directory --manual-public-ip-logging-ok -d '*.<your.domain>' -d <your.domain>
Enter fullscreen mode Exit fullscreen mode

确保引用*.<your.domain>以避免出现错误“未找到匹配项:*.<your.domain>”。

-d *.<your.domain>* 注意:和的顺序-d <your.domain>似乎并不重要。

certonly以下是单一证书的选项比较:

- --webroot -w <dir-path>
+ --manual --preferred-challenges dns --server https://acme-v02.api.letsencrypt.org/directory --manual-public-ip-logging-ok
Enter fullscreen mode Exit fullscreen mode

此外,其命令行选项的详细信息在这里

然后,命令回复:

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator manual, Installer None
Obtaining a new certificate
Performing the following challenges:
dns-01 challenge for <your.domain>

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please deploy a DNS TXT record under the name
_acme-challenge.<your.domain> with the following value:

<acme-challenge-value>

Before continuing, verify the record is deployed.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Press Enter to Continue
Enter fullscreen mode Exit fullscreen mode

配置 DNS 服务器,为您的域名添加一条记录。
该记录如下:

在哪里 什么
类型 TXT
姓名 _acme-challenge
价值 <acme-challenge-value> 命令显示如上

* 注意:您可能需要等待一段时间才能完成 DNS 传播。

然后按 Enter。

Waiting for verification...
Cleaning up challenges

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/<your.domain>/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/<your.domain>/privkey.pem
   Your cert will expire on 2019-08-01. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot
   again. To non-interactively renew *all* of your certificates, run
   "certbot renew"
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le
Enter fullscreen mode Exit fullscreen mode

完毕 : )

结论

于是我拿到了通配符证书,并把它应用到我的几台服务器上。
现在它运行良好,我的工作量减少了,但安全性几乎保持不变。

如果您正在寻找如何将 Let's Encrypt 的证书应用到 OpenBSD httpd 服务器,我在这里写道:

感谢您的阅读。祝您
安全愉快。

文章来源:https://dev.to/nabbisen/let-s-encrypt-wildcard-certificate-with-certbot-plo
PREV
使用 React 和 GraphQL-1 构建完整的应用程序
NEXT
安装 AUR 软件包 概要 如何使用 侧边栏主题