内容简介:let’s encrypt提供免费的
let’s encrypt提供免费的 https 证书,使用非常方便。可以在线自动更新,目前一个证书的有效期只有90天,所以90天内,至少要更新一次证书。所以可以通过定时任务 crontab 和 let’s encrypt 提供的证书管理工 certbot ,可以实现对证书的自动管理,可以对证书进行管理(增加,删除)等操作。
使用crontab 对证书进行自动管理
crontab -e 增加两条定时任务
# 每月的 1,7,21,28号, 4点30 更新证书 30 4 1,7,21,28 * * /usr/bin/certbot-2 renew # 每月的 1,7,21,28号, 5点30 重新启动nginx 服务器 30 5 1,7,21,28 * * /usr/sbin/nginx -t && killall nginx && /usr/sbin/nginx
查看当前的证书信息
certbot certificates 查看当前的所有的证书信息
certbot certificates
Saving debug log to /var/log/letsencrypt/letsencrypt.log
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Found the following certs:
Certificate Name: liuhaolin.com
Domains: liuhaolin.com www.liuhaolin.com
Expiry Date: 2019-04-03 23:25:43+00:00 (VALID: 89 days)
Certificate Path: /etc/letsencrypt/live/liuhaolin.com/fullchain.pem
Private Key Path: /etc/letsencrypt/live/liuhaolin.com/privkey.pem
默认的情况,证书到期前30天,执行 certbot renew 证书才会更新,每个证书有个配置文件。默认在文件夹 /etc/letsencrypt/renewal 下,有每个证书的信息。
cat /etc/letsencrypt/renewal/www.liuhaolin.com.conf
可以看到第一行的 renew_before_expiry = 30 days 意思是,距离证书到期时间为30天以内的时候,执行更新证书的命令 certbot-2 renew 才会更新证书。
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
猜你喜欢:- OpenSSL命令速查手册:证书、私钥与证书签名请求文件
- RHCE证书,CCNA证书
- DV SSL证书和其他证书有什么不同?
- 生成根证书CA及签发子证书及配置站点实践
- 技术讨论 | Apostille:让假证书以假乱真的证书伪造工具
- 360浏览器推出自有根证书计划 吁加快证书安全技术改造
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Don't Make Me Think
Steve Krug / New Riders Press / 18 August, 2005 / $35.00
Five years and more than 100,000 copies after it was first published, it's hard to imagine anyone working in Web design who hasn't read Steve Krug's "instant classic" on Web usability, but people are ......一起来看看 《Don't Make Me Think》 这本书的介绍吧!