侧边栏壁纸
  • 累计撰写 58 篇文章
  • 累计创建 67 个标签
  • 累计收到 1 条评论

给你的 halo 博客 https 一下——使用 certbot 配置 SSL 证书

lihaocheng
2021-04-12 / 0 评论 / 0 点赞 / 1,027 阅读 / 637 字
温馨提示:
晚上记得开启夜间模式哦

今天给 halo 博客配置 https,按照 halo 官方文档使用 certbot 来配置 SSL 证书

一、安装

1.CentOS

# 安装 certbot 以及 certbot nginx 插件
sudo yum install certbot python2-certbot-nginx -y

2.Debian

sudo apt update
sudo apt install python3-acme python3-certbot python3-mock python3-openssl python3-pkg-resources python3-pyparsing python3-zope.interface
sudo apt install python3-certbot-nginx

3.碰到的问题

(1)urllib3 安装失败

结果我执行完第一步就提示我——安装 python2-urllib3 失败,我想手动装一下urllib3 算了。

安装完 urllib3,继续执行第二步。
结果又提示我 urllib3 版本过低,啊这。

截屏20210412 下午3.03.25.png

那就按照他要求来吧

pip install --upgrade --force-reinstall 'requests==2.6.0' urllib3

继续按照文档走,终于完成了配置。

二、申请证书和自动续约

# 执行配置,中途会询问你的邮箱,如实填写即可
sudo certbot --nginx
# 自动续约
sudo certbot renew --dry-run

如果证书没了,重复上面的 2-3 步,就OK了!

三、删除证书

certbot delete

按提示删除即可

0

评论区