首页 > Web开发 > 详细

letsencrypt免费https泛域名(*.yourdomain.com)证书申请

时间:2021-06-08 17:07:06      阅读:15      评论:0      收藏:0      [点我收藏+]

安装环境CentOS
*.example.com形式的域名即为泛域名,不通的子域名共用一个证书,省去多次申请的烦恼
1.工具安装
安装最新的certbot
yum install -y certbot
已安装certbot,需要升级至高版本
yum update -y certbot

2.证书申请
将*.yourdomain.com 替换成你的泛域名
运行命令:
sudo certbot certonly --preferred-challenges dns --manual -d *.yourdomain.com --server https://acme-v02.api.letsencrypt.org/directory
下一步,输入A 选择同意条款。 后紧接着会提示先根据提示的信息。 在自己的域名控制台添加一条TXT解析记录
出现以下内容后,请在阿里云云解析中添加一条TXT解析记录

Please deploy a DNS TXT record under the name
_acme-challenge.yourdomain.com with the following value:

xxxxx

Before continuing, verify the record is deployed.
添加阿里云云解析TXT解析记录
技术分享图片
确认生效后。 继续生成ssl证书的步骤。 回车。 开始生成ssl证书。 生成的证书文件 为/etc/letsencrypt/live/yourdomain.com 下的fullchain.pem 和privkey.pem
3. 证书使用(nginx)
直接修改nginx 的主配置文件即可
/etc/nginx/conf.d/nginx.conf

4. 证书不自动更新(不适用于泛域名,泛域名只有每三个月手动更新一次)

手动更新域名终极版
certbot renew --manual-auth-hook /root/ssl/certbot-auth-dnspod.sh --manual-cleanup-hook "/root/ssl/certbot-auth-dnspod.sh clean"

letsencrypt免费https泛域名(*.yourdomain.com)证书申请

原文:https://www.cnblogs.com/ophui/p/14862812.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!