https-cert

ACEM工具

演示linux环境下通过dns方式申请证书
前提条件

  • 有域名

step 1

1
2
> curl  https://get.acme.sh | sh
> acme.sh --issue --dns -d mydomain.com

step 2

添加 dns txt记录
添加dns示例图

step3

带dns记录生效后,继续操作

1
2
3
> acme.sh  --renew -d mydomain.com 
--yes-I-know-dns-manual-mode-enough-go-ahead-please
>

step4

验证 txt记录是否生效

1

step5 [可选]

copy/安装 证书

前面证书生成以后, 接下来需要把证书 copy 到真正需要用它的地方.

注意, 默认生成的证书都放在安装目录下: ~/.acme.sh/, 请不要直接使用此目录下的文件, 例如: 不要直接让 nginx/apache 的配置文件使用这下面的文件. 这里面的文件都是内部使用, 而且目录结构可能会变化.

正确的使用方法是使用 –install-cert 命令,并指定目标位置, 然后证书文件会被copy到相应的位置, 例如:

Nginx example:

1
2
3
4
acme.sh --install-cert -d example.com \
--key-file /path/to/keyfile/in/nginx/key.pem \
--fullchain-file /path/to/fullchain/nginx/cert.pem \
--reloadcmd "service nginx force-reload"

资料

ACME客户端git仓库地址
参考


https-cert
https://jacksiongt.github.io/2021/04/30/https-cert/
作者
Jacksion
发布于
2021年4月30日
许可协议