certbot-auto不再支持所有的操作系统,新的ssl证书方法

最近在一台服务器执行letsencrypt-auto命令出现错误:

$ sudo ./certbot-auto 
Your system is not supported by certbot-auto anymore.
certbot-auto and its Certbot installation will no longer receive updates.
You will not receive any bug fixes including those fixing server compatibility
or security problems.
Please visit https://certbot.eff.org/ to check for other alternatives.
Saving debug log to /var/log/letsencrypt/letsencrypt.log

系统不再被支持!!!

查看certbot(https://github.com/certbot/certbot/releases)

2021年1月的更新日志:

●certbot-auto was deprecated on all systems. For more information about this
change, see
https://community.letsencrypt.org/t/certbot-auto-no-longer-works-on-debian-based-systems/139702/7.

可知:

certbot-auto不再支持所有的操作系统!根据作者的说法,certbot团队认为维护certbot-auto在几乎所有流行的UNIX系统以及各种环境上的正常运行是一项繁重的工作,加之certbot-auto是基于python 2编写的,而python 2即将寿终正寝,将certbot-auto迁移至python 3需要大量工作,这非常困难,因此团队决定放弃certbot-auto的维护。

既然如此,现在我们还能继续使用certbot吗?certbot团队使用了基于snap的新的分发方法。

1. 环境
操作系统:CentOS 7

Webserver:Nginx

2. 安装letsencrypt
2.1. 安装letsencrypt之前,需要先安装snaps

a. 先安装epel

$ yum install epel-release

b. 安装snapd

$ yum install snapd

c. 启用snapd.socket

$ systemctl enable --now snapd.socket

d. 创建/var/lib/snapd/snap/snap之间的链接。

$ ln -s /var/lib/snapd/snap /snap

e. 退出账号并重新登录,或者重启系统,确保snap启用。

f. 将snap更新至最新版本。

$ sudo snap install core

$ sudo snap refresh core

2.2. 卸载已安装的certbot

如果之前在系统上已经部署过certbot,则需要先将其进行卸载。

a. 卸载certbot

$ yum remove certbot

b. 根据certbot安装位置删除相关文件。

$ rm /usr/local/bin/certbot-auto

c. 删除certbot附加软件包。

$ rm -rf /opt/eff.org/certbot

2.3. 安装certbot

a. 通过snap安装certbot

$ snap install --classic certbot

b. 创建/snap/bin/certbot的软链接,方便certbot命令的使用。

$ ln -s /snap/bin/certbot /usr/bin/certbot

3. letsencrypt的使用
3.1. 获取证书。

a. 生成证书。

确保nginx处于运行状态,需要获取证书的站点在80端口,并且可以正常访问。

$ certbot certonly --nginx --email xxx@mail.com -d a.do.com -d b.do.com

b. 更新nginx配置并重启nginx

3.2. 更新证书。

$ certbot renew

ubuntu系统的话,使用如下命令方式安装:

$ sudo snap install --classic certbot

参考链接


certbot-auto不再支持所有的操作系统,新的ssl证书方法

发布者

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注