certbot 申请通配符证书
安装 cerbot
1
2
3
4apt install cerbot
查看可用命令
certbot --help all申请证书
1
2
3
4
5
6
7
8
9certbot certonly -d *.hmlxy.cn --manual --config-dir config --work-dir work --logs-dir logs --preferred-challenges dns -m xx@xx.com --agree-tos --eff-email
certonly 只获取或更新证书
--manual 以交互方式获取证书
-d 要为其获取证书的域的用逗号分隔的列表(通配符直接使用*.xxx.xx)
--preferred-challenges 用于指定在验证域名所有权时使用的方法Eg, "dns" or "http,dns"
-m 重要帐户通知的电子邮件地址
--agree-tos 同意 ACME 服务器的订阅者协议
--eff-email 要与 EFF 共享你的电子邮件地址上面就是让你验证域名是属于你的,将上述值添加到 DNS 解析中,如下图:
然后回车看到下面内容就成功了。
安装证书
随便安装在一个 web 服务上,如我的博客 nginx 配置:
然后能使用 https 访问就成功啦!!!