Generate let’s encrypt(TLS) use acme.sh script
Install acme.sh
execute this command on your terminal.
curl https://get.acme.sh | sh -s email=my@example.com
email 可以设置成个人或者省略
命令执行完成后,会在~
目录下创建一个.acme.sh 文件夹
cd ~/.acme.sh
entry acme.sh directory
Get config from CF
在登陆 CloudFlare 中,需要两个参数进行配置
- CF_TOKEN: need you generate key
- CF_Account_ID: just copy it from the given position of page
CF_Account_ID
登陆 cf 账号,选择域名后,位置所在如下图
AccountID值便是账户ID
CF_Token
在上一步获取账户 ID 下方有一个获取您的 API 令牌
点击创建,对应配置选择如下
使用 编辑区域 DNS
对应添加框选中的区域后,点击 继续以显示摘要
点击创建令牌,得到当前 Token(注意保存,只显示这一次)
![[CleanShot 2024-02-03 at 17.20.42@2x.png]]
可使用下面 curl 命令测试
Generate TLS
导入从 CF 获取的值到 Terminal 中
export CF_Account_ID=""
export CF_Token=""
使用命令通过 CF 的 DNS 验证,并生成 TLS 证书
/acme.sh --issue -d your_domain -d your_another_domain --dns dns_cf -k ec-256 --debug
(–debug 参数可显示更多的日志信息输出)
日志跑完后,会在当前目录下生成以 your_domain 为名字的文件夹,所需的配置信息都在此目录下
Common command
- ./acme.sh help
- ./acme.sh list