分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 代码编程

SSL For Free 申请免费https SSL 凭证

发布时间:2023-09-06 01:36责任编辑:蔡小小关键词:http

打开 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 凭证

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

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved