刚配置了下Let’s Encrypt,chrome浏览器里有绿条出来,看官网其它平台问题应该也不大。我尚未研究这个工做原理,关键是刚花了几千块给公司买了个收费的证书认证。这里写下配置过程(https://github.com/Neilpang/acme.sh):nginx
curl https://get.acme.sh | sh
acme.sh --issue --dns -d www.xxx.com
www.xx.com是你的域名,会返回以下信息:git
[Sat Jul 2 14:12:55 CST 2016] Skip register account key [Sat Jul 2 14:12:55 CST 2016] Creating csr [Sat Jul 2 14:12:55 CST 2016] Single domain='www.xxx.com' [Sat Jul 2 14:12:55 CST 2016] Verify each domain [Sat Jul 2 14:12:55 CST 2016] Getting webroot for domain='www.xxx.com' [Sat Jul 2 14:12:55 CST 2016] Getting token for domain='www.xxx.com' [Sat Jul 2 14:12:58 CST 2016] Add the following TXT record: [Sat Jul 2 14:12:58 CST 2016] Domain: _acme-challenge.www.xxx.com.com [Sat Jul 2 14:12:58 CST 2016] TXT value: 5G3SB534HHnl1bjTa1vz1SKfF6aXMTSQFFY8HJe96BKDtl2220 [Sat Jul 2 14:12:58 CST 2016] Please be aware that you prepend _acme-challenge. before your domain [Sat Jul 2 14:12:58 CST 2016] so the resulting subdomain will be: _acme-challenge.www.xxx.com [Sat Jul 2 14:12:58 CST 2016] Please add the TXT records to the domains, and retry again.
给域名添加一个txt解析规则,主机记录填_acme-challenge.www.xxx.com.com
,记录值填5G3SB534HHnl1bjTa1vz1SKfF6aXMTSQFFY8HJe96BKDtl2220
github
待刚才配置的域名升效后,执行以下命令:web
acme.sh --renew -d www.xx.com
会看到生成cert成功提示。
生成的目录通常在 ~/acme.sh/www.xx.com 下。有了key和cert文件,咱们就能够用来配置nginx ssl了。chrome
我用 -w 模式没有成功,不知道缘由。相关的nginx也配置对了,启用了sh debug查看相关过程,都是没有问题了,可是最后一条验证老是说 invalid response。浏览器