获取免费https认证 详解certbot使用步骤

  • https是个好东西, 它能让为你的信息进行加密, 让信息更安全, chrome会将没有https的网站标记为"不安全"
  • 早些时候, 将http转换为https是需要收费的, 但现在有了一些开源项目, 为我们提供免费的https服务,
  • 更可贵的是, 不仅免费, 而且安装非常简单

免费https项目主页: https://certbot.eff.org/

按需获取https安装脚本

  • 选择服务软件(apach和nginx)
  • 选择操作系统类型

详细步骤:以nginx配合腾讯云centos7镜像为例

安装epel 增强源(腾讯云的centos7镜像是配置好的, 可以跳过这一步)

yum -y install epel-release
wget -O /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repo
# 刷新yum源
yum clean all && yum makecache && yum update

安装yum-utils

yum -y install yum-utils
yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional

安装 python2-certbot-nginx

yum install python2-certbot-nginx

将cerbot配置到nginx

certbot --nginx
  • 报错处理(2019年8月5日):

如果上一步报错:


pip install requests==2.6.0
easy_install --upgrade pip

    1. 输入你的邮箱名
    1. 同意协议
    1. 允许邮件推送
    1. 选择添加https的域名


对配置子域名有疑问的, 可以查看我之前写过的nginx配置二级域名

    1. 同时保留http和https
    1. 配置完成, 查看测试报表
  • 测试zhaoolee.com


https://www.ssllabs.com/ssltest/analyze.html?d=zhaoolee.com

查看网站

  • https://zhaoolee.com
  • 子域名: https://git.zhaoolee.com
  • 子域名 https://cloud.zhaoolee.com/login
  • 同时原http连接方式不受影响 http://zhaoolee.com

免费证书续期

  • 目前安装的https每隔90天,就会失效, 你可以在失效之前使用certbot renew --dry-run命令, 免费进行续费更新

小结:

随着谷歌强制推行https, 支持https的网站也越来越多, 博主认为这是一件好事, 能让我们在互联网的数据更安全, 记得听过一期网络安全公开课, 课上推荐将http改为https的种种好处, 而且还推荐了将支持https网站的所有http请求强制转换为https的插件,chrome插件链接 HTTPS Everywhere

你可能感兴趣的:(获取免费https认证 详解certbot使用步骤)