自己搭建的网站提示不安全,因此安装了下Let’s Encrypt证书
系统要求
python2.7 不需要python2.7 不需要python2.7 不需要
重要的事情说三遍, 看有些文章说需要python2.7
在centos6上折腾了许久,还是无法成功安装证书,试着删除python2.7,重新安装,一切ok
安装
| 1 | git clone https://github.com/letsencrypt/letsencrypt | 
你的邮件地址是注册用的, 会有一个确认邮件发送到你的邮箱
按照提示,一步一步操作即可(nginx->all_web->redirect)
生成的文件默认在/etc/letsencrypt目录下
Let’s Encrypt证书有效期是90天, 到期重新执行一遍就可以了
也可以使用命令./letsencrypt-auto renew
https://github.com/letsencrypt/letsencrypt实际上已经指向https://github.com/certbot/certbot,
在https://certbot.eff.org/似乎有更加友好的安装方式, 自己没有试过, 有精力的可以试下
但是由于自己搭建的个别网站存在防止混合内容, https://不可用, 没办法只好还原
| 1 | if ($scheme != "http") { | 
其他
- 查看证书列表(包括存放位置/有效期) - certbot certificates
- 泛域名证书 - certbot certonly --manual --agree-tos -d mingilin.com,*.mingilin.com,*.web.mingilin.com,*.github.mingilin.com
- 证书详细信息 - openssl x509 -in /etc/letsencrypt/live/mingilin.com/cert.pem -noout -text
- 查看证书的过期时间 - openssl x509 -in /etc/letsencrypt/live/mingilin.com/cert.pem -noout -enddate
- 检查1天内证书是否过期 - openssl x509 -in /etc/letsencrypt/live/mingilin.com/cert.pem -noout -checkend 86400
参考文档
- http://www.laozuo.org/7676.html
- http://www.jianshu.com/p/eaac0d082ba2
- 帮助: ./letsencrypt-auto --help all
- https://letsencrypt.org/
- https://certbot.eff.org/
- http://www.laozuo.org/2573.html