{"id":3870,"date":"2017-07-16T00:20:34","date_gmt":"2017-07-15T16:20:34","guid":{"rendered":"http:\/\/blog.hoyo.idv.tw\/?p=3870"},"modified":"2018-11-21T13:37:30","modified_gmt":"2018-11-21T05:37:30","slug":"%e4%bd%bf%e7%94%a8-lets-encrypt-%e5%85%8d%e8%b2%bb-ssl-%e6%8f%90%e4%be%9b-https","status":"publish","type":"post","link":"https:\/\/blog.hoyo.idv.tw\/?p=3870","title":{"rendered":"\u4f7f\u7528 Let\u2019s Encrypt \u514d\u8cbb SSL \u63d0\u4f9b HTTPS"},"content":{"rendered":"<h2>\u4ec0\u9ebc\u662f\u00a0Let\u2019s Encrypt<\/h2>\n<pre class=\"lang:default decode:true\">Let's Encrypt\u662f\u4e00\u500b\u65bc2015\u5e74\u4e09\u5b63\u5ea6\u63a8\u51fa\u7684\u6578\u4f4d\u6191\u8b49\u8a8d\u8b49\u6a5f\u69cb\uff0c\u65e8\u5728\u4ee5\u81ea\u52d5\u5316\u6d41\u7a0b\u6d88\u9664\u624b\u52d5\u5efa\u7acb\u548c\u5b89\u88dd\u6191\u8b49\u7684\u8907\u96dc\u6d41\u7a0b\uff0c\u4e26\u63a8\u5ee3\u4f7f\u5168\u7403\u8cc7\u8a0a\u7db2\u4f3a\u670d\u5668\u7684\u52a0\u5bc6\u9023\u63a5\u7121\u6240\u4e0d\u5728\uff0c\u70ba\u5b89\u5168\u7db2\u7ad9\u63d0\u4f9b\u514d\u8cbb\u7684SSL\/TLS\u6191\u8b49\u3002<\/pre>\n<p><strong>\u6578\u91cf\u9650\u5236<\/strong><\/p>\n<ul>\n<li><a href=\"https:\/\/letsencrypt.org\/docs\/rate-limits\/\" target=\"_blank\" rel=\"noopener\">Rate Limits<\/a><\/li>\n<\/ul>\n<pre class=\"lang:default decode:true \">2018\u5e748\u67081\u65e5\r\nThe main limit is Certificates per Registered Domain, (50 per week).<\/pre>\n<p><strong>\u5ba2\u6236\u7aef<\/strong><\/p>\n<ul>\n<li><a href=\"https:\/\/letsencrypt.org\/docs\/client-options\/\" target=\"_blank\" rel=\"noopener\">ACME Client Implementations<\/a><\/li>\n<\/ul>\n<p>\u5b98\u65b9\u63a8\u85a6\u4f7f\u7528 Certbot \uff0c\u5be6\u969b\u6e2c\u8a66\u5e7e\u500b\u4e5f\u662f\u63a8\u85a6 Certbot<\/p>\n<p>--<\/p>\n<h2>Certbot<\/h2>\n<ul>\n<li><a href=\"https:\/\/blog.gtwang.org\/linux\/secure-nginx-with-lets-encrypt-ssl-certificate-on-ubuntu-and-debian\/\" target=\"_blank\" rel=\"noopener\">NGINX \u4f7f\u7528 Let\u2019s Encrypt \u514d\u8cbb SSL \u6191\u8b49\u8a2d\u5b9a HTTPS \u5b89\u5168\u52a0\u5bc6\u7db2\u9801\u6559\u5b78<\/a><\/li>\n<\/ul>\n<p>\u8a2d\u5b9a\u904b\u4f5c\u7a0b\u5f0f\u74b0\u5883\u53ca\u53d6\u5f97\u7a0b\u5f0f<\/p>\n<pre class=\"lang:default decode:true\"># mkdir \/etc\/certbot\r\n# cd \/etc\/certbot\r\n# wget https:\/\/dl.eff.org\/certbot-auto\r\n# chmod +x certbot-auto<\/pre>\n<p>--<\/p>\n<h2>certbot-auto \u5b89\u88dd\u3001\u8a2d\u5b9a<\/h2>\n<p>\u9996\u5148\u88f8\u8dd1\u4e00\u6b21\uff0c\u7a0b\u5f0f\u6703\u5075\u6e2c\u74b0\u5883\u4e26\u4e14\u88dc\u9f4a\u6240\u9700\u5957\u4ef6<\/p>\n<pre class=\"lang:default decode:true\"># \/etc\/certbot\/certbot-auto<\/pre>\n<p>\u5728\u7db2\u7ad9\u6839\u76ee\u9304\u5efa\u7acb\u898f\u5b9a\u8a8d\u8b49\u76ee\u9304\u00a0.well-known\/acme-challenge\/ \u5f8c\u5373\u53ef\u7522\u751f\u8b49\u66f8<\/p>\n<pre class=\"lang:default decode:true\"># mkdir -p \/WEB\/.well-known\/acme-challenge\/\r\n# \/etc\/certbot\/certbot-auto certonly --webroot -w \/WEB\/ -d app.soundu.life<\/pre>\n<ul>\n<li>-w \u7db2\u8def\u6839\u76ee\u9304\u8def\u5f91<\/li>\n<li>-d \u7db2\u5740<span style=\"color: #333333; font-style: normal; line-height: 24.375px;\">\uff0c\u5be6\u969b\u64cd\u4f5c\u6642\u8a72\u7db2\u5740\u5fc5\u9808\u5df2\u7d93\u53ef\u4f7f\u7528<\/span><\/li>\n<\/ul>\n<p>--<\/p>\n<h2>\u8a2d\u5b9a\u81ea\u52d5\u66f4\u65b0\u8b49\u66f8\u6392\u7a0b<\/h2>\n<pre class=\"lang:default decode:true\">vi \/etc\/crontab\r\n\r\n\r\n# renew SSL\r\n0  7  *  *  *  root  \/etc\/certbot\/certbot-auto renew\r\n1  7  *  *  *  root  systemctl reload httpd\r\n<\/pre>\n<p>--<\/p>\n<h2>SSL \u8b49\u66f8\u6aa2\u67e5<\/h2>\n<ul>\n<li><a href=\"https:\/\/cryptoreport.geotrust.com\/checker\/\" target=\"_blank\" rel=\"noopener\">SSL Checker | GeoTrust CryptoReport<\/a><\/li>\n<li><a href=\"https:\/\/globalsign.ssllabs.com\/\" target=\"_blank\" rel=\"noopener\">SSL Server Test (Powered by Qualys SSL Labs)<\/a><\/li>\n<\/ul>\n<p>--<\/p>\n<p>&nbsp;<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p class=\"pvc_stats all \" data-element-id=\"3870\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> &nbsp;1,806&nbsp;total views, &nbsp;2&nbsp;views today<\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u4ec0\u9ebc\u662f\u00a0Let\u2019s Encry...<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p class=\"pvc_stats all \" data-element-id=\"3870\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> &nbsp;1,806&nbsp;total views, &nbsp;2&nbsp;views today<\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[31],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/3870"}],"collection":[{"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3870"}],"version-history":[{"count":18,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/3870\/revisions"}],"predecessor-version":[{"id":5325,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/3870\/revisions\/5325"}],"wp:attachment":[{"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3870"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3870"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3870"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}