{"id":1692,"date":"2016-12-20T17:37:45","date_gmt":"2016-12-20T09:37:45","guid":{"rendered":"http:\/\/clear.vimge.com\/?p=1692"},"modified":"2016-12-20T17:57:17","modified_gmt":"2016-12-20T09:57:17","slug":"lets-encrypt-ssl-https","status":"publish","type":"post","link":"https:\/\/blog.vimge.com\/archives\/other\/lets-encrypt-ssl-https.html","title":{"rendered":"\u514d\u8d39\u597d\u7528\u7684SSL\u57df\u540d\u7b7e\u540d\uff0cLet’s Encrypt\u4f7f\u7528\u653b\u7565"},"content":{"rendered":"

Let’s Encrypt\u662f\u7531 ISRG\uff08Internet Security Research Group\uff0c\u4e92\u8054\u7f51\u5b89\u5168\u7814\u7a76\u5c0f\u7ec4\uff09\u53d1\u8d77\uff0c\u7531Mozilla\u3001Cisco\u3001Akamai\u3001Electronic Frontier Foundation \u548c Chrome \u7b49\u4f17\u591a\u516c\u53f8\u548c\u673a\u6784\u652f\u6301\u7684\u514d\u8d39\u3001\u81ea\u52a8\u5316\u3001\u5f00\u653e\u7684\u8bc1\u4e66\u7b7e\u53d1\u670d\u52a1\u3002<\/p>\n

Let’s Encrypt \u4e0e IdenTrust \u7684 DST Root CA \u505a\u4e86\u4ea4\u53c9\u8ba4\u8bc1\uff0c\u517c\u5bb9\u6027\u8fd8\u662f\u975e\u5e38\u4e0d\u9519\u7684\uff0c\u76ee\u524d\u80fd\u505a\u5230\u4e3b\u6d41\u7cfb\u7edf\u5305\u62ecXP\u7cfb\u7edf\u4e5f\u80fd\u5f97\u5230\u5f88\u597d\u7684\u652f\u6491\uff0c\u540c\u65f6\u5b89\u5168\u6027\u4e0a\u9762Let’s Encrypt\u652f\u6301ECC \u8bc1\u4e66\uff08\u76ee\u6d4b\u91c7\u7528\u7684\u662fECDHE \u5bc6\u94a5\u4ea4\u6362\u3001RSA \u7b7e\u540d\u65b9\u5f0f\uff09<\/p>\n

Let’s Encrypt\u76ee\u524d\u5b8c\u5168\u514d\u8d39\uff0c\u652f\u63013\u4e2a\u6708\u8bc1\u4e66\u6709\u6548\u671f\uff0c\u5230\u671f\u53ef\u81ea\u52a8\u7eed\u7b7e\uff0c\u5173\u4e8e\u6709\u6548\u671f\u8fd9\u4e2a\u5e94\u8be5\u662f\u4e00\u4e2a\u5c31\u5b89\u5168\u6027\u8003\u91cf\u7684\u7b56\u7565\uff0c\u597d\u5728\u81ea\u52a8\u5316\u505a\u7684\u975e\u5e38\u4e0d\u9519\uff0c\u518d\u52a0\u4e0a\u5404\u79cd\u81ea\u52a8\u5316\u7684\u7533\u8bf7\u3001\u8fc7\u671f\u7eed\u7b7e\u65b9\u6848\uff0c\u5df2\u7ecf\u505a\u5230\u5f88\u65b9\u4fbf\u4e86\u3002<\/p>\n

Let’s Encrypt \u7684\u8bc1\u4e66\u7b7e\u53d1\u8fc7\u7a0b\u4f7f\u7528\u7684\u662f ACME \uff08Automated Certificate Management Environment\uff09\u534f\u8bae\uff0c\u76ee\u524d\u5b98\u65b9\u548c\u7b2c\u4e09\u65b9\u5de5\u5177\u90fd\u662f\u57fa\u4e8e\u6b64\u534f\u8bae\uff0c\u5b98\u65b9\u63a8\u8350\u5de5\u5177\u5217\u8868\u5728\u8fd9\u91cc<\/a><\/p>\n

\u8fd9\u91cc\u63a8\u8350\u00a0acme.sh<\/a>\u00a0\u5b9e\u6d4b\u7cfb\u7edf\u517c\u5bb9\u6027\u975e\u5e38\u597d\uff0c\u5bf9\u5176\u4ed6\u5e93\u7684\u4f9d\u8d56\u548c\u7248\u672c\u4f9d\u8d56\u76f8\u5bf9\u8f83\u5c0f\uff0cCentOS 5.8\u7cfb\u7edf python 2.4.3 \u5b8c\u7f8e\u5b9e\u73b0\uff0c\u8fd9\u91cc\u7b80\u5355\u8bb2\u4e00\u4e0bacme.sh\u7684\u5b89\u88c5\u548c\u4f7f\u7528\u5427\uff0c\u5b98\u65b9\u6709\u4e2d\u6587\u6559\u7a0b \u5728\u8fd9\u91cc<\/a><\/p>\n

git clone https:\/\/github.com\/Neilpang\/acme.sh.git
\ncd acme.sh
\n.\/acme.sh –install<\/p>\n

\u652f\u6301\u53c2\u6570\u5217\u8868\u5982\u4e0b\uff0c\u901a\u5e38\u4f7f\u7528 accountemail\u5c31\u53ef\u4ee5\u4e86<\/p>\n

–home ~\/myacme
\n–certhome ~\/mycerts \\
\n–accountemail “hi@acme.sh”
\n–accountkey ~\/myaccount.key
\n–accountconf ~\/myaccount.conf
\n–useragent “this is my client.”<\/p>\n

DNS\u9a8c\u8bc1\u65b9\u5f0f\u751f\u6210\u7b7e\u540d<\/strong><\/p>\n

\u8bc1\u4e66\u751f\u6210\u652f\u6301\u57df\u540dTXT\u89e3\u6790\u548c\u6587\u4ef6\u81ea\u52a8\u751f\u6210\u9a8c\u8bc1\uff0c\u5bf9\u4e8e\u4e0d\u65b9\u4fbf\u516c\u7f51WEB\u81ea\u52a8\u751f\u6210\u6587\u4ef6\u8bbf\u95ee\u7684\u60c5\u51b5\u4f7f\u7528TXT\u57df\u540d\u89e3\u6790\u8fd8\u662f\u975e\u5e38\u65b9\u4fbf\u7684\uff0c\u6267\u884c\u4e0b\u9762\u7684\u547d\u4ee4\u83b7\u53d6TXT\u89e3\u6790\u53c2\u6570<\/p>\n

acme.sh –issue –dns -d mydomain.com<\/p>\n

\u6309\u547d\u4ee4\u6267\u884c\u7ed3\u679c\u505aTXT\u89e3\u6790\u5373\u53ef\uff0c\u89e3\u6790\u751f\u6548\u540e\u6267\u884c\u4e0b\u9762\u7684\u547d\u4ee4\u751f\u6210\u8bc1\u4e66<\/p>\n

acme.sh –renew -d mydomain.com<\/p>\n

HTTP\u81ea\u52a8\u751f\u6210\u9a8c\u8bc1\u6587\u4ef6\u751f\u6210\u7b7e\u540d<\/strong><\/p>\n

\u8fd9\u79cd\u65b9\u5f0f\u8981\u6c42\u6307\u5b9a\u516c\u7f51\u53ef\u8bbf\u95ee\u7684webroot\u76ee\u5f55\uff0c\u5de5\u5177\u4f1a\u81ea\u52a8\u751f\u6210\u9a8c\u8bc1\u6587\u4ef6\u8bbf\u95ee\u6210\u529f\u540e\u5b8c\u6210\u9a8c\u8bc1\u5e76\u81ea\u52a8\u5220\u9664\u6587\u4ef6<\/p>\n

acme.sh –issue -d mydomain.com -d mydomain2.com –webroot \/home\/www\/webroot<\/p>\n

\u6ce8\u610f\u4ee5\u4e0a\u547d\u4ee4\u90fd\u652f\u6301\u6307\u5b9a\u591a\u57df\u540d\uff08\u6bcf\u4e2a\u57df\u540d\u5bf9\u5e94\u4e00\u4e2a -d \u53c2\u6570\uff09<\/em><\/p>\n

\u8bc1\u4e66\u751f\u6210\u540e\uff0c\u81ea\u52a8\u5728\u7cfb\u7edf\u7684crontab\u6bcf\u5929\u665a\u4e0a12\u70b9\u81ea\u52a8\u6267\u884c\u66f4\u65b0\u547d\u4ee4\uff0c\u5982\u679c\u8bc1\u4e66\u8fc7\u671f\u81ea\u52a8\u7eed\u671f<\/p>\n

 <\/p>\n","protected":false},"excerpt":{"rendered":"

Let’s Encrypt\u662f\u7531 ISRG\uff08Internet Security Research G […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1,5],"tags":[143,144,146,145],"_links":{"self":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts\/1692"}],"collection":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/comments?post=1692"}],"version-history":[{"count":5,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts\/1692\/revisions"}],"predecessor-version":[{"id":1697,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts\/1692\/revisions\/1697"}],"wp:attachment":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/media?parent=1692"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/categories?post=1692"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/tags?post=1692"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}