您的位置:首页 > 理论基础 > 计算机网络

SSL For Free 申请免费https SSL 凭证

2018-01-13 22:03 459 查看
打开 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配置

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: