4

用lego来代替acme申请免费ssl证书

 7 months ago
source link: https://bajie.dev/posts/20240124-lego_acme/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

用lego来代替acme申请免费ssl证书

2024-01-24 1 分钟阅读

amce申请证书实在是太烦了,对于一台只有1cpu 512m的vps来说,装这个东西简直就是费时费劲。

好在有人干脆开发了一个go语言的工具lego,这东西完全能够替代掉ACME

https://github.com/go-acme/lego/ 

只有一个执行文件,极简主义:

申请证书一句话:

 lego --email="[email protected]" --domains="example.com" --http run 

回答一下Yes

然后生成的证书都放在.lego/certificates/目录下

续费也是一句话

 lego --email="[email protected]" --domains="example.com" --http renew

及其简单,也方便搬迁。生成的证书crt是带证书链条的

申请好就可以装trojan了。实在是方便

如果DNS是托管在阿里云上,可以开一个阿里ram账号,然后用dns的api验证

ALICLOUD_ACCESS_KEY=aaaaaaaa  ALICLOUD_SECRET_KEY=bbbbbbbb \
./lego --email [email protected] --dns alidns --domains *.ddky.com run

如果DNS是托管在namesilo上,同样可以开一个api的key,时间一定要放长,否则不生效!

NAMESILO_API_KEY=ccccc NAMESILO_PROPAGATION_TIMEOUT=3600 NAMESILO_POLLING_INTERVAL=120 NAMESILO_TTL=3600 \
./lego --email [email protected] --dns namesilo --domains *.rendoumi.com run

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK