image-20260130161036114Let’s Encrypt 是一家免费、开放、自动化的证书颁发机构,由非营利组织互联网安全研究组 (ISRG) 运作。

我们可以从Let’s Encrypt获取ssl证书使用,免费的,简直不要太香!

准备一个域名

当然得有一个域名了。

安装certbot工具

我是ubuntu系统,可以通过这种方式进行安装,其他方式请自行百度

1
sudo apt install certbot

执行命令

1
certbot certonly --manual --preferred-challenges dns -d "*.xiaoyun.life" -d xiaoyun.life  --email lj17770640253@163.com --agree-tos

其中的参数名含义分别为:

  • -d:域名
  • –email: 邮箱

执行后你将会看到

1
2
3
4
5
6
7
8
9
10
11
12
13
14
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Requesting a certificate for charlee44.com and *.charlee44.com

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please deploy a DNS TXT record under the name:

_acme-challenge.xiaoyun.life.

with the following value:

xxxxxxxxxxxxxxxxxxxxxxxxxxxx

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Press Enter to Continue

此时需要我们配置域名解析

配置域名解析

给_acme-challenge.xiaoyun.life设置txt类型的解析结果。

以我的腾讯云为例:

image-20260130160817034

certbot控制台处按回车

证书生成

证书将会保存在:/etc/letsencrypt/live/xiaoyun.life/下。

应用证书

后面根据实际用途使用即可。