{"id":337,"date":"2018-03-14T11:16:09","date_gmt":"2018-03-14T03:16:09","guid":{"rendered":"https:\/\/cloudbool.com\/archive\/?p=337"},"modified":"2018-03-14T11:16:09","modified_gmt":"2018-03-14T03:16:09","slug":"use-acme-sh-issue-letsencrypt-free-wildcard-certificate","status":"publish","type":"post","link":"https:\/\/cloudbool.com\/archive\/use-acme-sh-issue-letsencrypt-free-wildcard-certificate.html","title":{"rendered":"\u5229\u7528acme.sh\u7533\u8bf7letsencrypt\u514d\u8d39wildcard\u8bc1\u4e66"},"content":{"rendered":"<p>\u6700\u8fd1\u4e00\u76f4\u5728\u8ba8\u8bbalet&#8217;s encrypt\u7684wildcard\u8bc1\u4e66\u4ec0\u4e48\u65f6\u5019\u51fa\u6765\uff0c\u6628\u5929\u8fd8\u5728\u60f3\u4ec0\u4e48\u65f6\u5019\u51fa\u6765\u4e86\u8981\u53ca\u65f6\u4f53\u9a8c\u4e00\u4e0b\uff0c\u6ca1\u60f3\u5230\u4eca\u65e9\u4e00\u5927\u65e9\u8d77\u6765\u5c31\u770b\u5230\u5927\u5bb6\u5728\u8ba8\u8bbalet&#8217;s encrypt\u7684\u91ce\u5361\u51fa\u6765\u4e86\uff0c\u627e\u4e86\u4e2a\u4e13\u95e8\u6d4b\u8bd5\u7684\u57df\u540d\u4ee5\u53ca\u95f2\u7f6e\u7684VPS\u7acb\u9a6c\u8bd5\u4e86\u4e00\u4e0b\uff0c\u8bb0\u5f55\u4e00\u4e0b\u6d4b\u8bd5\u8fc7\u7a0b\u3002<br \/>\n<!--more--><br \/>\n\u8fd9\u6b21\u548c\u4e4b\u524d\u4e0d\u4e00\u6837\u7684\u662f\uff0c\u6211\u7528\u7684\u662facme.sh\u811a\u672c\u800c\u4e0d\u662fcertbot\u4e86\uff0c\u4e4b\u524d\u4e00\u76f4\u542c\u8bf4\u4e86\u8fd9\u4e2a\u811a\u672c\uff0c\u4f46\u662f\u90fd\u8fd8\u6ca1\u7528\u8fc7\uff0c\u8fd9\u6b21\u8d81\u7740wildcard\u7684\u652f\u6301\u53ef\u4ee5\u8bd5\u8bd5\u4e86\u3002<br \/>\n\u9996\u5148\u80af\u5b9a\u662f\u5b89\u88c5acme.sh\u4e86\uff0c\u6765\u81ea\u5b98\u65b9\u7684\u5b89\u88c5\u65b9\u6cd5\uff0c\u4e00\u884c\u547d\u4ee4\u5c31\u641e\u5b9a\uff1a<\/p>\n<pre><code class=\"bash\">curl  https:\/\/get.acme.sh | sh\n<\/code><\/pre>\n<p>\u4e00\u884c\u547d\u4ee4\u5c31\u628aacme.sh\u5b89\u88c5\u5230<strong>\/root\/.acme.sh \/<\/strong>\u4e0b\u9762\u4e86\uff0c\u867d\u7136acme.sh\u4f1a\u81ea\u52a8\u6dfb\u52a0\u8fdb.bashrc\u6587\u4ef6\uff0c\u4f46\u4e3a\u4e86\u65b9\u4fbf\u4f7f\u7528\uff0c\u6211\u4eec\u6700\u597d\u8fd8\u662fsource\u4e00\u4e0b.bashrc\u6587\u4ef6\uff0c\u5f53\u7136\uff0c\u9000\u51faSSH\u91cd\u65b0\u767b\u5f55\u4e5f\u53ef\u4ee5\uff1a<\/p>\n<pre><code>source .bashrc\n<\/code><\/pre>\n<p>\u8fd9\u6837\u6211\u4eec\u5c31\u80fd\u76f4\u63a5\u4f7f\u7528<strong>acme.sh<\/strong>\u547d\u4ee4\u4e86\u3002<br \/>\n\u770b\u6587\u6863\uff0c\u76ee\u524dlet&#8217;s encrypt\u7684wildcard\u8bc1\u4e66\u6682\u65f6\u53ea\u652f\u6301DNS\u9a8c\u8bc1\u7684\u65b9\u5f0f\u7b7e\u53d1\uff0c\u6240\u4ee5\uff0c\u6309\u7167\u6587\u6863\uff0c\u6211\u4eec\u9700\u8981\u5229\u7528\u5404\u4e2aDNS\u7684API\u8fdb\u884c\u9a8c\u8bc1\uff0c<a href=\"https:\/\/github.com\/Neilpang\/acme.sh\/tree\/master\/dnsapi\">\u8fd9\u91cc\u662f\u652f\u6301\u7684\u5404\u5bb6DNS\u670d\u52a1\u5546\u7684\u5217\u8868<\/a>\uff0c\u6839\u636e\u5217\u8868\u627e\u5230\u76f8\u5e94\u7684\u9a8c\u8bc1\u51ed\u8bc1\u5e76\u7528export\u6dfb\u52a0\u5c31\u597d\u4e86\u3002<br \/>\n\u7531\u4e8e\u6211\u7528\u7684\u662fHE\u7684DNS\uff0c\u6839\u636e\u6587\u6863\u53ea\u9700\u8981\u7528\u6237\u540d\u548c\u5bc6\u7801\u5c31\u884c\u4e86\uff0c\u4e5f\u5c31\u4e24\u884c\u800c\u5df2\uff1a<\/p>\n<pre><code>export HE_Username=\"he_username\"\nexport HE_Password=\"he_password\"\n<\/code><\/pre>\n<p>\u8fd9\u91cc\u6709\u4e2a\u5751\u5c31\u662f\uff0c\u6211\u4e4b\u524d\u662f\u7528keepass\u968f\u673a\u751f\u6210\u7684\u5bc6\u7801\uff0c\u6b63\u597d\u5e26\u4e86\u4e2a<strong>!<\/strong>\uff0c\u5bfc\u81f4export\u7684\u65f6\u5019\u8001\u662f\u62a5\u9519\uff0c\u6539\u4e86\u4e0b\u5bc6\u7801\u624d\u597d\u3002<br \/>\n\u63a5\u4e0b\u6765\u5c31\u662f\u5229\u7528acme.sh\u7533\u8bf7wildcard\u4e86\uff0c\u8fd8\u662f\u6309\u7167\u5b98\u65b9\u7684\u6587\u6863\uff0c\u683c\u5f0f\u5982\u4e0b\uff1a<\/p>\n<pre><code>acme.sh --issue --dns dns_he -d cloudbool.com -d *.cloudbool.com\n<\/code><\/pre>\n<p>\u7b49\u5f85\u65f6\u95f4\u6709\u70b9\u957f\uff0c120\u79d2\u5012\u8ba1\u65f6\u4e4b\u540e\uff0c\u53d1\u73b0\u5c31\u7533\u8bf7\u597d\u4e86\uff0c\u7533\u8bf7\u6210\u529f\u4e4b\u540e\u4f1a\u6709\u63d0\u793a\u544a\u77e5\u8bc1\u4e66\u7684\u4f4d\u7f6e\uff1a<\/p>\n<pre><code>[Wed Mar 14 02:44:38 UTC 2018] Your cert is in  \/root\/.acme.sh\/goov.win\/goov.win.cer\n[Wed Mar 14 02:44:38 UTC 2018] Your cert key is in  \/root\/.acme.sh\/goov.win\/goov.win.key\n[Wed Mar 14 02:44:38 UTC 2018] The intermediate CA cert is in  \/root\/.acme.sh\/goov.win\/ca.cer\n[Wed Mar 14 02:44:38 UTC 2018] And the full chain certs is there:  \/root\/.acme.sh\/goov.win\/fullchain.cer\n<\/code><\/pre>\n<p>\u63a5\u4e0b\u6765\u53ea\u9700\u8981\u5c06\u8bc1\u4e66\u590d\u5236\u5230\u5408\u9002\u7684\u4f4d\u7f6e\uff0c\u7136\u540e\u914d\u7f6eNginx\u5c31\u53ef\u4ee5\u4e86\uff0c\u653e\u4e24\u5f20\u56fe\u5c55\u793a\u4e00\u4e0b\u7ed3\u679c\uff1a<br \/>\n<img decoding=\"async\" src=\"https:\/\/cloudbool.com\/archive\/wp-content\/uploads\/2018\/03\/letsencrypt-wildcard-ssl-certificate-1.png\" alt=\"letsencrypt-wildcard-ssl-certificate\" \/><br \/>\n<img decoding=\"async\" src=\"https:\/\/cloudbool.com\/archive\/wp-content\/uploads\/2018\/03\/letsencrypt-wildcard-ssl-certificate-1.png\" alt=\"letsencrypt-wildcard-ssl-certificate\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u4e00\u76f4\u5728\u8ba8\u8bbalet&#8217;s encrypt\u7684wildcard\u8bc1\u4e66\u4ec0\u4e48\u65f6\u5019\u51fa\u6765\uff0c\u6628\u5929\u8fd8\u5728\u60f3\u4ec0\u4e48\u65f6\u5019\u51fa\u6765 &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/cloudbool.com\/archive\/use-acme-sh-issue-letsencrypt-free-wildcard-certificate.html\"> <span class=\"screen-reader-text\">\u5229\u7528acme.sh\u7533\u8bf7letsencrypt\u514d\u8d39wildcard\u8bc1\u4e66<\/span> \u67e5\u770b\u5168\u6587 &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"footnotes":""},"categories":[182],"tags":[201,76],"class_list":["post-337","post","type-post","status-publish","format-standard","hentry","category-linux","tag-lets-encrypt","tag-nginx"],"_links":{"self":[{"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/posts\/337","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/comments?post=337"}],"version-history":[{"count":0,"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/posts\/337\/revisions"}],"wp:attachment":[{"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/media?parent=337"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/categories?post=337"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudbool.com\/archive\/wp-json\/wp\/v2\/tags?post=337"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}