免费申请https证书

Server 林涛 5766℃ 0评论

在这里我们使用 Let’s Encrypt

  • 下载签名工具 wget https://dl.eff.org/certbot-auto
  • 给执行权限chmod a+x ./certbot-auto
  • 测试是否成功./certbot-auto --help

  • 构建生成证书 ./certbot-auto certonly --webroot -w <webrootpath> -d <domain> 
    <webrootpath>填入自的web项目根目录路径 
    <domain> 填入自己要签名的域名

  • 最后看到”Congratulation”的那个提示就是配置成功

生成的证书与密钥放在: 
/etc/letsencrypt/live/<domain>/fullchain.pem; 
/etc/letsencrypt/live/<domain>/privkey.pem;

然后可以去 
https://mozilla.github.io/server-side-tls/ssl-config-generator/ 
生成一个nginx 的https的配置文件

如果是nginx,默认web目录为/var/www/html 
如果是nginx,默认配置文件为/etc/nginx/nginx.conf

原理上就是在webroot目录上创建特定文件,let’sencrypt的服务器可以验证这个域名拥有者是你,然后就生成了证书

参考: 
https://linuxstory.org/deploy-lets-encrypt-ssl-certificate-with-certbot/ 
https://ksmx.me/letsencrypt-ssl-https/

如需转载请注明: 转载自26点的博客

本文链接地址: 免费申请https证书

转载请注明:26点的博客 » 免费申请https证书

喜欢 (0)
发表我的评论
取消评论

表情