Lets Encrypt 免费证书制作

背景

Let’s Encrypt是一家全球证书颁发机构,由ISRG(Internet Security Research Group)创立,目的是简化网站的安全加密。Let’s Encrypt证书申请快速(只需要拥有域名)、免费、且支持泛域名证书,非常适用于个人网站、博客及一些简单的门户类网站。但由于只进行比较基础的域名验证,暂不支持OV(Organization Validation)、EV(Extended Validation)验证,证书有效期只有90天,因此大型或高安全级别的网站,比如购物、银行等,使用需要慎重。
本文谨记录项目开发过程中Let’s Encrypt证书的申请制作过程以及后续运维遇到的一些问题。

制作过程

域名

要申请制作一个SSL证书,首先要拥有此证书对应域名的控制权限,后续操作中需要新增域名记录用作验证。

Certbot客户端

对于可以进行shell命令行操作的用户来说,官方推荐使用certbot客户端来制作证书。

安装certbot

sudo apt update
sudo apt-get install software-properties-common
sudo add-apt-repository universe
sudo add-apt-repository ppa:certbot/certbot
sudo apt update
sudo apt install certbot python3-certbox-nginx

泛域名证书制作

certbot certonly  -d *.abcd.com -d abcd.com --manual --preferred-challenges dns-01  --server https://acme-v02.api.letsencrypt.org/directory

• 会提示输入邮箱,用于后续证书过期告警提示
• 在域名check环节,根据提示,需要在域名服务器上生成一条txt记录
在这里插入图片描述
dig -t TXT _acme-challenge.abcd.com可查看是否生效
• 最终会提示生成成功
在这里插入图片描述
• 生成的证书,默认存放路径在/etc/letsencrypt

相关问题

CAA报错

在证书制作过程中,遇到过CAA报错。

Press Enter to Continue                                                                                                                                                                                 Waiting for verification...
Cleaning up challenges
Failed authorization procedure. abcd.com (dns-01): urn:ietf:params:acme:error:dns :: DNS problem: SERVFAIL looking up CAA for abcd.com - the domain's nameservers may be malfunctioning, abcd.com (dns-01): urn:ietf:params:acme:error:dns :: DNS problem: SERVFAIL looking up CAA for abcd.com - the domain's nameservers may be malfunctioning
IMPORTANT NOTES:
 - The following errors were reported by the server:
   Domain: abcd.com
   Type:   None
   Detail: DNS problem: SERVFAIL looking up CAA for abcd.com - the
   domain's nameservers may be malfunctioning
   Domain: abcd.com
   Type:   None
   Detail: DNS problem: SERVFAIL looking up CAA for abcd.com - the
   domain's nameservers may be malfunctioning

参考官网:https://letsencrypt.org/zh-cn/docs/caa/
在域名服务商增加CAA配置

Name    Type    Value
abcd.com.   CAA 0 issue "letsencrypt.org"
0 issue "sectigo.com"

关于续租

由于本项目域名是在中万网购买的,其没有提供API接口用于配置TXT记录。但续租的时候需要用到–manual-auth-hook,这是通过脚本自动配置新的TXT值,当前域名的环境暂时不支持。在90天到期之前,重新进行证书制作,然后再把证书传至服务器上。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值