现在还能使用的SSL(FREE)认证机构。

StartSSL 已死。 17年五月之后将不再颁发Free证书。

申请后永远是等待中。


所以请使用 'Let's Encrypt'免费且受信任的机构.


1.确保服务器安装GIT 环境。

2.确保PYTHON版本大于 2.7.1


第一步,从github克隆letsencrypt的开源脚手架

git clone https://github.com/letsencrypt/letsencrypt



第二步,开始配置你的证书



cd letsencrypt

./letsencrypt-auto certonly --standalone --email 你的邮箱@.com -d 你的域名.com -d www.你的域名.com




过程大约三分钟。


如果出现报错:


Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/virtualenv.py", line 2363, in <module>
main()
File "/usr/lib/python3/dist-packages/virtualenv.py", line 719, in main
symlink=options.symlink)
File "/usr/lib/python3/dist-packages/virtualenv.py", line 988, in create_environment
download=download,
File "/usr/lib/python3/dist-packages/virtualenv.py", line 918, in install_wheel
call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT)
File "/usr/lib/python3/dist-packages/virtualenv.py", line 812, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /opt/eff.org/certbot/venv/bin/python2.7 - setuptools pkg_resources pip wheel failed with error code 2
root@iZbp1j2710orfy6c8xo5cbZ:/home/letsencrypt# OSError: Command /opt/eff.org/certbot/venv/bin/python2.7 - setuptools pkg_resources pip wheel failed with error code 2




请更新virtualenv



sudo pip install --upgrade virtualenv



再重复敲一遍配置命令即可!



Agree

Yes


如果你配置了邮箱,它会需要你验证。根据提示操作即可。


完成Let's Encrypt证书的生成后,在

"/etc/letsencrypt/live/你的域名.com/"

目录下有4个文件

cert.pem - Apache服务器端证书

chain.pem - Apache根证书和中继证书

fullchain.pem - Nginx所需要ssl_certificate文件

privkey.pem - 安全证书KEY文件


如果用的Nginx

配置如下




# SSL configuration

listen 443 ssl default_server;
ssl on;

ssl_certificate /etc/letsencrypt/live/你的域名.com/fullchain.pem;

ssl_certificate_key /etc/letsencrypt/live/你的域名.com/privkey.pem;

server_name www.你的域名.com;




Let's Encrypt证书是有效期90天。


快要过期的时候


直接


./letsencrypt-auto certonly --renew-by-default --email 你的邮箱@.com -d 你的域名.com -d www.你的域名.com



这样即可完成更新继续免费使用。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值