certbot 自动获取 https 证书
2024-3-21
| 2024-6-10
字数 536阅读时长 2 分钟
type
status
date
slug
summary
tags
category
icon
password
AI summary
Last edited time
Jun 10, 2024 09:58 AM
原本自建的 vaultwardeng 服务是通过 http 访问的,但是 iOS 上的 Bitwardeng 应用如果要访问家里的 vaultwardeng 应用,添加自签的 https 证书又比较麻烦,想到之前在阿里云上买的 10 年域名,为什么不直接弄一个二级域名通过 Let's encrypt 来弄个真正的 https 证书呢?直接开搞

cloudflare token准备

certbot 可以通过 cloudflare 的 api 来做域名验证(验证某个域名的归属),因此要先准备 cloudflare 的 api token。从安全角度考虑,该 api token 只需要编辑 DNS 权限。
  1. 先添加要解析的域名
notion image
  1. API Tokens → Create Token
notion image
  1. 选择 Edit zone DNS 模板
notion image
  1. 精确到某个域名范围(推荐)
notion image
  1. 一路提交,将拿到的 token 存到 cloudflare.ini 文件中

Certbot 获取证书

docker-compose.yml
启动 certbot
签发成功后可以看到拿到的证书
fullchain2.pem 和 privkey2.pem 可以配置到 nginx 中做 SSL 证书使用

📎 参考文章

  • HTTPS
  • Certbot
  • MySQL 批量修改日期格式S.M.A.R.T 原则
    Loading...