


{"id":98,"date":"2025-08-16T08:47:56","date_gmt":"2025-08-16T07:47:56","guid":{"rendered":"https:\/\/blog.unclecy.com\/?p=98"},"modified":"2025-08-16T09:10:08","modified_gmt":"2025-08-16T08:10:08","slug":"get-zerossl-certs-using-acmesh","status":"publish","type":"post","link":"https:\/\/blog.unclecy.com\/index.php\/2025\/08\/16\/get-zerossl-certs-using-acmesh\/","title":{"rendered":"\u4f7f\u7528acme.sh\u7533\u8bf7ZeroSSL\u8bc1\u4e66"},"content":{"rendered":"<p>\u9996\u5148\u5efa\u8bae\u53bb<a href=\"https:\/\/app.zerossl.com\/\" target=\"_blank\" rel=\"noopener\">ZeroSSL<\/a>\u7684\u5b98\u65b9\u7f51\u7ad9\u6ce8\u518c\u4e00\u4e2a\u5e10\u53f7\uff0c\u7136\u540e\u5728<a href=\"https:\/\/app.zerossl.com\/developer\" target=\"_blank\" rel=\"noopener\">\u5f00\u53d1\u8005<\/a>\u9875\u9762\u91cc\u9762\u7684EAB Credentials for ACME Clients\u4e0b\u8fb9\uff0c\u70b9\u51fbGenerate\uff0c\u91cc\u9762\u751f\u6210\u7684\u4e24\u4e2a\u5b57\u7b26\u4e32\uff0c\u8bb0\u5f97\u4fdd\u5b58\u4e00\u4e0b\u3002<\/p>\n<p><!--more--><\/p>\n<p>\u63a5\u7740\u5728\u7cfb\u7edf\u4e0a\u5b89\u88c5acme.sh\uff0c\u6211\u4f7f\u7528\u7684\u662fFreeBSD\uff0c\u7528pkg\u5b89\u88c5\u5373\u53ef\u3002<\/p>\n<p><code>pkg install -y acme.sh<\/code><\/p>\n<p>\u5207\u6362\u5230\u521b\u5efa\u7684acme\u7528\u6237\u3002<\/p>\n<p><code>su - acme<\/code><\/p>\n<p>\u5c06\u9ed8\u8ba4\u7684CA\u6539\u6210ZeroSSL\uff0c\u6700\u65b0\u7248\u7684\u53ef\u4ee5\u4e0d\u7528\uff0c\u56e0\u4e3a\u9ed8\u8ba4\u5c31\u662f\u5b83\u4e86\u3002<\/p>\n<p><code>acme.sh --set-default-ca  --server zerossl<\/code><\/p>\n<p>\u7136\u540e\u5c06\u4e0a\u8fb9\u4fdd\u5b58\u7684\u90a3\u4e24\u4e32\u4e1c\u897f\uff0c\u586b\u5230\u4e0b\u8fb9\u7684\u547d\u4ee4\u91cc\u9762\uff0c\u7136\u540e\u56de\u8f66\u8fd0\u884c\u3002<\/p>\n<p><code>acme.sh  --register-account  --server zerossl \\<br \/>\n--eab-kid  &lt;\u4f60\u7684kid&gt; \\<br \/>\n--eab-hmac-key  &lt;\u4f60\u7684key&gt;<br \/>\n<\/code><\/p>\n<p>\u65b0\u5efa\u4e00\u4e2a\u76ee\u5f55\uff0c\u6bd4\u5982<code>\/usr\/local\/www\/ssl<\/code>\uff0c\u8bb0\u5f97\u8981\u7ed9acme\u5199\u5165\u7684\u6743\u9650\uff0c\u8fd8\u6709www\u8bfb\u53d6\u7684\u6743\u9650\u3002<\/p>\n<p>\u5c06\u4e0b\u8fb9\u8fd9\u6bb5\u914d\u7f6e\u52a0\u5165\u5230\u5bf9\u5e94\u7533\u8bf7\u8bc1\u4e66\u57df\u540d\u7684NGINX\u914d\u7f6e\u6587\u4ef6\u4e2d\u3002<\/p>\n<blockquote><p>server {<br \/>\nlisten 80;<\/p>\n<p>server_name &lt;\u4f60\u7684\u57df\u540d&gt;;<\/p>\n<p>root \/usr\/local\/www\/ssl;<\/p>\n<p>}<\/p><\/blockquote>\n<p>\u8bb0\u5f97\u52a0\u5b8c\u4e4b\u540e\u91cd\u65b0\u542f\u52a8NGINX\uff0c\u540c\u65f6\u8bb0\u5f97\u5f0080\u7aef\u53e3\u3002<\/p>\n<p>\u63a5\u7740\u7533\u8bf7\u8bc1\u4e66\u3002<\/p>\n<p><code>acme.sh --issue -d \u4f60\u7684\u57df\u540d --webroot \/usr\/local\/www\/ssl<\/code><\/p>\n<p>\u6700\u540e\u5b89\u88c5\u4f60\u7684\u8bc1\u4e66\uff0c\u4e0d\u8fc7\u8bb0\u5f97\u7ed9acme\u8fd9\u4e2a\u7528\u6237\u63d0\u5347\u4e00\u4e0b\u6743\u9650\uff0c\u6bd4\u5982sudo\u4ec0\u4e48\u7684\u3002\u5b89\u88c5\u8bc1\u4e66\u7684\u4f4d\u7f6e\u81ea\u5df1\u9009\u4e00\u4e2a\uff0c\u6bd4\u5982\u8fd9\u91cc\u7684\u662f<code>\/usr\/local\/etc\/acme\/certs<\/code>\u3002<\/p>\n<p><code>acme.sh --install-cert -d &lt;\u4f60\u7684\u57df\u540d&gt; \\<br \/>\n--cert-file \/usr\/local\/etc\/acme\/certs\/&lt;\u4f60\u7684\u57df\u540d&gt;.cert \\<br \/>\n--key-file \/usr\/local\/etc\/acme\/certs\/&lt;\u4f60\u7684\u57df\u540d&gt;.key \\<br \/>\n--fullchain-file \/usr\/local\/etc\/acme\/certs\/&lt;\u4f60\u7684\u57df\u540d&gt;.fullchain \\<br \/>\n--reloadcmd \"sudo service nginx restart\"<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9996\u5148\u5efa\u8bae\u53bbZeroSSL\u7684\u5b98\u65b9\u7f51\u7ad9\u6ce8\u518c\u4e00\u4e2a\u5e10\u53f7\uff0c\u7136\u540e\u5728\u5f00\u53d1\u8005\u9875\u9762\u91cc\u9762\u7684EAB Credentials for ACME Clients\u4e0b\u8fb9\uff0c\u70b9\u51fbGenerate\uff0c\u91cc\u9762\u751f\u6210\u7684\u4e24\u4e2a\u5b57\u7b26\u4e32\uff0c\u8bb0\u5f97\u4fdd\u5b58\u4e00\u4e0b\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-98","post","type-post","status-publish","format-standard","hentry","category-uncategorised"],"_links":{"self":[{"href":"https:\/\/blog.unclecy.com\/index.php\/wp-json\/wp\/v2\/posts\/98","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.unclecy.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.unclecy.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.unclecy.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.unclecy.com\/index.php\/wp-json\/wp\/v2\/comments?post=98"}],"version-history":[{"count":5,"href":"https:\/\/blog.unclecy.com\/index.php\/wp-json\/wp\/v2\/posts\/98\/revisions"}],"predecessor-version":[{"id":103,"href":"https:\/\/blog.unclecy.com\/index.php\/wp-json\/wp\/v2\/posts\/98\/revisions\/103"}],"wp:attachment":[{"href":"https:\/\/blog.unclecy.com\/index.php\/wp-json\/wp\/v2\/media?parent=98"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.unclecy.com\/index.php\/wp-json\/wp\/v2\/categories?post=98"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.unclecy.com\/index.php\/wp-json\/wp\/v2\/tags?post=98"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}