码迷,mamicode.com
首页 > 其他好文 > 详细

用 letsencrypt 生成 SSL 证书

时间:2018-03-28 16:44:47      阅读:146      评论:0      收藏:0      [点我收藏+]

标签:key   private   usr   .com   ash   tps   log   添加   bash   

letsencrypt 生成 SSL 证书

  • 事先配置好访问域名(也可以在本地 hosts 配置)
  • 在nginx 对应虚拟主机添加一个验证区域:


配置 nginx

server {
    ...
    location ~ /.well-known {
        allow all;
    }
    ...
}


生成 SSL

git clone https://github.com/letsencrypt/letsencrypt
cd letsencrypt
./letsencrypt-auto certonly
  • 选择使用: webroot 进行验证


一劳永逸

letsencrypt 证书有效期为3个月, 其生成证书路径在: /etc/letsencrypt/live/<domain>/ 下, 证书名称为 fullchain.pem, 私钥为 privatekey.pem

可以做一个软连接:

ln -sv /usr/local/openresty/nginx/conf/ssl -> /etc/letsencrypt/live/<domain>/

用 letsencrypt 生成 SSL 证书

标签:key   private   usr   .com   ash   tps   log   添加   bash   

原文地址:https://www.cnblogs.com/tiantiandas/p/letsencrypt_generate_ssl_certificate.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!