用 Let's Encrypt 给网站加上 HTTPS 完全指南

2016-05-29 19:25:34 +08:00
 wxiluo

周末看 Google I/O 2016 ,谷歌大力在推 HTTPS ,于是上手实践把自己的博客加上,与恶心的运营商劫持抗争到底。

《用 Let's Encrypt 给网站加上 HTTPS 完全指南》传送门:

https://ksmx.me/letsencrypt-ssl-https/?utm_source=v2ex&utm_medium=forum&utm_campaign=20160529

最后成果, Qualys SSL Labs 安全测试 A+:

11051 次点击
所在节点    程序员
24 条回复
013231
2016-06-01 10:44:48 +08:00
文章中關於 Nginx 配置的部分有些問題:

1. http://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_stapling
"If the ssl_certificate file does not contain intermediate certificates, the certificate of the server certificate issuer should be present in the ssl_trusted_certificate file."
由於上面 ssl_certificate 已經使用了 fullchian.pem, 合成 root_ca_cert_plus_intermediates 證書并配置 ssl_trusted_certificate 的部分是可以省掉的.

2.` resolver`的作用是"resolve names of upstream servers into addresses", 在這個配置中, resolver 是用來解析 OCSP 服務器的域名的, 和你自己的域名沒有關係. 事實上如果這裡把 resolver 設為 DNSPod 的 NS, 會導致 Let's Encrypt OCSP 服務器的域名無法解析.
wxiluo
2016-06-02 12:34:29 +08:00
@013231 感谢指正。

问题 1 ,我确实知道可以省略,但不清楚为什么模版中没有省去,猜测可能有兼容问题?我实际去掉 ssl_trusted_certificate 后,确实没有任何问题。

问题 2 , resolver ,这个我确实没有查证,立刻修改。
wxiluo
2016-06-02 12:42:30 +08:00
@013231 已经更新原文。再次感谢。🙏
013231
2016-06-02 19:53:36 +08:00
@wxiluo 生成的那個模板並不知道你的 ssl_certificate 是否含中間證書呀. 如果用了不含中間證書的 cert.pem, ssl_trusted_certificate 就不能省略. 你的文章中 ssl_certificate 用了 fullchain.pem, 所以後面就不用設置 ssl_trusted_certificate 了.

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/282061

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX