码迷,mamicode.com
首页 > Web开发 > 详细

SSL For Free 申请免费https SSL 凭证

时间:2018-01-13 23:46:21      阅读:314      评论:0      收藏:0      [点我收藏+]

标签:listen   步骤   down   nload   延长   crt   bundle   name   gpo   

打开 SSL For Free网站(https://www.sslforfree.com) ,在输入框中填入你要申请 Let’s Encrypt 凭证的网域名称,可以用空白来分隔不同的网址,例如[subdomain.domain.com domain.com other.com](这个没试过),输入后点选右边的[Create Free SSL Certificate]继续。 
技术分享图片
二、

提供了三种验证网站的方式,此处选择使用手动的验证方式,即[Manually Verification]:点选下方的[Manually Verify Domain]继续。 
技术分享图片
三、

按照手工验证的步骤说明[Upload Verification Files]依次操作, 
1.点击 第 步骤1 中的 Download File #1 链接下载验证文件 
2.上传验证文件到服务器,确认步骤5中的链接能正常访问后,点击 
[Download SSL Certificate]。 
技术分享图片
四、 
如果通过验证后,就会开始为生成所申请网站 SSL 凭证。当凭证生成后,可以看到[Get Notified of Expiration],由于申请的凭证有效期只有90天,所以可以在此设定一组 Email 和密码,即可在凭证过期前(一周左右)取得通知,以免错过延长(renew)时间。 
技术分享图片
点击[Download All SSL Certificate Files]下载凭证文件压缩包,解压缩后可以看到private.key、ca_bundle.crt 和 certificate.crt 三个文件! 
技术分享图片

五、修改域名配置(以nginx为例)

  • http跳转到https配置

server { 
listen 80; 
server_name my.domain.com; 
index index.html; 
return 301 https://servernamerequest_uri
}

server { 
listen 443 ssl; 
server_name my.domain.com; 
index index.html; 
access_log logs/access_my_domain_com.log; 
ssl_certificate /etc/ssl/my_domain_com/certificatet.crt;#对应压缩包里的certificatet.crt 
ssl_certificate_key /etc/ssl/my_domain_com/private.key;#对应压缩包里的private.key 
location / { 
root /opt/vhosts/my_domian_com; 

}

  • http,https同时可以访问配置

server { 
listen 80; 
listen 443 ssl; 
server_name my.domain.com; 
index index.html; 
ssl_certificate /etc/ssl/my_domain_com/certificatet.crt;#对应压缩包里的certificatet.crt 
ssl_certificate_key /etc/ssl/my_domain_com/private.key;#对应压缩包里的private.key 
access_log logs/access_my_domain_com.log; 
location / { 
root /opt/vhosts/my_domian_com; 

}

  • 验证修改后的配置文件是否正确

$ ./nginx -t -c /usr/local/nginx/conf/nginx.conf 
the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok#验证通过 
./nginx -s reload #重新加载nginx配置

SSL For Free 申请免费https SSL 凭证

标签:listen   步骤   down   nload   延长   crt   bundle   name   gpo   

原文地址:https://www.cnblogs.com/aaronguo/p/8280679.html

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