{"id":921,"date":"2021-12-26T00:42:12","date_gmt":"2021-12-25T16:42:12","guid":{"rendered":"https:\/\/cychien.tw\/wordpress\/?p=921"},"modified":"2021-12-26T01:21:45","modified_gmt":"2021-12-25T17:21:45","slug":"unifi-cloudkey-gen2-%e5%a6%82%e4%bd%95%e6%9b%b4%e6%8f%9b-letsencrypt-%e6%86%91%e8%ad%89%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/cychien.tw\/wordpress\/2021\/12\/26\/unifi-cloudkey-gen2-%e5%a6%82%e4%bd%95%e6%9b%b4%e6%8f%9b-letsencrypt-%e6%86%91%e8%ad%89%ef%bc%9f\/","title":{"rendered":"UniFi CloudKey Gen2+ \u5982\u4f55\u66f4\u63db LetsEncrypt \u6191\u8b49\uff1f"},"content":{"rendered":"\r\n<p>\u7e7c\u4e0a\u7bc7\u6587\u7ae0 <a rel=\"noreferrer noopener\" href=\"https:\/\/cychien.tw\/wordpress\/2021\/12\/09\/%e5%9c%a8unifi-controller%e5%a6%82%e4%bd%95%e5%8c%af%e5%85%a5letsencrypt%e7%b0%bd%e7%bd%b2%e7%9a%84%e6%86%91%e8%ad%89%ef%bc%9f\/\" data-type=\"post\" data-id=\"868\" target=\"_blank\">\u5728UniFi Controller\u5982\u4f55\u532f\u5165LetsEncrypt\u7c3d\u7f72\u7684\u6191\u8b49\uff1f<\/a>\uff0c\u6c92\u60f3\u5230\u5f88\u5feb\u5c31\u5728\u7db2\u8def\u793e\u5718\u8cfc\u5165\u7269\u7f8e\u50f9\u5ec9\u7684\u4e8c\u624b UniFi CloudKey Gen2+\uff0c\u4f46\u6309\u8457\u4e0a\u7bc7\u6587\u7ae0\u7684\u65b9\u5f0f\uff0c\u96d6\u7136\u4e5f\u662f\u6709\u627e\u5230\u5c0d\u61c9\u7684 java keystore\uff0c\u4f46\u5be6\u969b\u5c07\u6191\u8b49\u66f4\u63db\u91cd\u65b0\u555f\u52d5\u4e4b\u5f8c\uff0c\u537b\u9084\u662f\u4e00\u6a23\u4f7f\u7528\u539f\u5ee0\u5167\u5efa\u7684\u81ea\u7c3d\u6191\u8b49\uff0cLetsEncrypt\u7684\u6191\u8b49\u4e26\u672a\u751f\u6548\u3002\u627e\u4e86\u4e00\u4e0b\u793e\u7fa4\u7684\u5e16\u5b50(<a href=\"https:\/\/community.ui.com\/questions\/Certificate-on-Cloud-Key-GEN2-plus\/111c4fcd-363c-40c9-ba09-4cbac5ef5081\" data-type=\"URL\" target=\"_blank\" rel=\"noreferrer noopener\">Certificate-on-Cloud-Key-GEN2-plus<\/a>)\uff0c\u770b\u8d77\u4f86\u539f\u5ee0\u7684\u56de\u8986\u662f CloudKey \u4e26\u4e0d\u652f\u63f4\u5ba2\u88fd\u5316\u6191\u8b49\uff0c\u5efa\u8b70\u76f4\u63a5\u4f7f\u7528 unifi.ui.com \u4f86\u9032\u884c\u7ba1\u7406\u8fd1\u7aef\u8a2d\u5099\u3002\u4e0d\u904e\u6211\u81ea\u5df1\u662f\u4e0d\u611b\u7528 unifi.ui.com \u9032\u884c\u7ba1\u7406\uff0c\u56e0\u70ba\u7db2\u9801\u7684\u56de\u61c9\u6548\u80fd\u90fd\u6c92\u6709\u672c\u5730\u7aef\u76f4\u63a5\u7ba1\u7406\u4f86\u5f97\u5feb\uff0c\u770b\u4f86\u5f97\u518d\u7e7c\u7e8c\u4ed4\u7d30\u6df1\u5165\u7814\u7a76\u4e00\u4e0b\u3002<\/p>\r\n\r\n<!--more-->\r\n\r\n\r\n\r\n<p>\u9996\u5148\u7576\u7136\u8981\u5148\u958b\u555f ssh \u9023\u7dda\u4ee5\u4fbf\u9032\u5165 CloudKey \u7684\u4f5c\u696d\u7cfb\u7d71\u88e1\u4ed4\u7d30\u89c0\u5bdf\uff0c\u9032\u5165\u4e4b\u5f8c\u5c31\u5148\u770b\u770b\u662f\u54ea\u500b Process \u4f54\u7528\u4e86 Port 443\u3002\u7528 netstat \u6307\u4ee4\u53ef\u4ee5\u770b\u5230\u662f PID 1229 \u4f54\u7528\u4e86 Port 443\uff0c\u518d\u4f86\u7528 ps \u6307\u4ee4\u4ed4\u7d30\u770b\u770b PID 1229 \u662f\u4ec0\u9ebc Process\uff0c\u67e5\u770b\u5c31\u767c\u73fe\u539f\u4f86\u662f Node.js \u4f54\u7528\u4e86\uff0c\u540c\u6642\u57f7\u884c\u7684 javascript \u662f \/usr\/share\/unifi-core\/app \u4e0b\u9762\u7684 service.js\u3002<\/p>\r\n\r\n\r\n\r\n<p><img decoding=\"async\" width=\"600\" height=\"186\" class=\"wp-image-922 lazyload\" style=\"--smush-placeholder-width: 600px; --smush-placeholder-aspect-ratio: 600\/186;width: 600px;\" data-src=\"https:\/\/cychien.tw\/wordpress\/wp-content\/uploads\/2021\/12\/01.netstat.ps_.png\" alt=\"\" data-srcset=\"https:\/\/cychien.tw\/wordpress\/wp-content\/uploads\/2021\/12\/01.netstat.ps_.png 922w, https:\/\/cychien.tw\/wordpress\/wp-content\/uploads\/2021\/12\/01.netstat.ps_-300x93.png 300w, https:\/\/cychien.tw\/wordpress\/wp-content\/uploads\/2021\/12\/01.netstat.ps_-768x238.png 768w\" data-sizes=\"(max-width: 600px) 100vw, 600px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" \/><\/p>\r\n\r\n\r\n\r\n<p>\u518d\u4f86\u770b\u770b \/usr\/share\/unifi-core\/app\u4e0b\u9762\u6709\u4e9b\u4ec0\u9ebc\u6a94\u6848\uff0c\u627e\u5230\u4e86\u4e00\u500b config\/config.yaml\u3002<\/p>\r\n\r\n\r\n\r\n<p><img decoding=\"async\" width=\"600\" height=\"234\" class=\"wp-image-923 lazyload\" style=\"--smush-placeholder-width: 600px; --smush-placeholder-aspect-ratio: 600\/234;width: 600px;\" data-src=\"https:\/\/cychien.tw\/wordpress\/wp-content\/uploads\/2021\/12\/02.config.yaml_.png\" alt=\"\" data-srcset=\"https:\/\/cychien.tw\/wordpress\/wp-content\/uploads\/2021\/12\/02.config.yaml_.png 922w, https:\/\/cychien.tw\/wordpress\/wp-content\/uploads\/2021\/12\/02.config.yaml_-300x117.png 300w, https:\/\/cychien.tw\/wordpress\/wp-content\/uploads\/2021\/12\/02.config.yaml_-768x299.png 768w\" data-sizes=\"(max-width: 600px) 100vw, 600px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" \/><\/p>\r\n\r\n\r\n\r\n<p>\u518d\u6253\u958b config.yaml \u7684\u5167\u5bb9\u4f86\u770b\u770b\u5c31\u4e00\u76ee\u77ad\u7136\u4e86\u3002\u539f\u4f86\u55ae\u7368\u57f7\u884c UniFi Controller \u6642\u662f\u4e00\u500b\u55ae\u7d14\u7684 J2EE Application\uff0c\u4f46\u653e\u5728 UniFi CloudKey \u6642\uff0c\u7531\u65bc\u5167\u5efa\u591a\u7a2e\u61c9\u7528\u7a0b\u5f0f\uff0c\u53c8\u8981\u5f9e\u540c\u4e00\u500b\u5165\u53e3\u9032\u5165\u7ba1\u7406\uff0c\u6240\u4ee5\u5728\u5165\u53e3\u7db2\u7ad9\u6539\u63a1 Node.js \u4f5c\u70ba\u5165\u53e3\u7684\u7ba1\u7406\uff0c\u7136\u5f8c\u4e5f\u4f5c\u70ba\u5176\u4ed6\u61c9\u7528\u7a0b\u5f0f\uff08\u4f8b\u5982\uff1aUniFi Network\u4e5f\u5c31\u662f UniFi Controller, UniFi Protect \u7b49\u7b49\uff09\u7684\u53cd\u5411\u4ee3\u7406\u7a0b\u5f0f\uff0c\u6240\u4ee5\u63db\u4e86 UniFi Network \u7684 Keystore \u6191\u8b49\u7576\u7136\u4e0d\u6703\u751f\u6548\uff08\u56e0\u7232\u5be6\u969b\u662f\u7531 Node.js \u4f86\u63d0\u4f9b HTTPS \u670d\u52d9\uff09<\/p>\r\n\r\n\r\n\r\n<p><img decoding=\"async\" width=\"600\" height=\"624\" class=\"wp-image-924 lazyload\" style=\"--smush-placeholder-width: 600px; --smush-placeholder-aspect-ratio: 600\/624;width: 600px;\" data-src=\"https:\/\/cychien.tw\/wordpress\/wp-content\/uploads\/2021\/12\/03.config.yaml_.content.png\" alt=\"\" data-srcset=\"https:\/\/cychien.tw\/wordpress\/wp-content\/uploads\/2021\/12\/03.config.yaml_.content.png 922w, https:\/\/cychien.tw\/wordpress\/wp-content\/uploads\/2021\/12\/03.config.yaml_.content-288x300.png 288w, https:\/\/cychien.tw\/wordpress\/wp-content\/uploads\/2021\/12\/03.config.yaml_.content-768x799.png 768w\" data-sizes=\"(max-width: 600px) 100vw, 600px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" \/><\/p>\r\n\r\n\r\n\r\n<p>\u518d\u5f80\u5f8c\u6372\u52d5\u770b\u4e00\u4e0b\uff0c\u5c31\u770b\u5230\u4e86\u6191\u8b49\u7684\u8def\u5f91\uff0c\u539f\u4f86\u6191\u8b49\u8ddf\u79c1\u9470\u6a94\u6848\u662f\u653e\u5728 \/data\/unifi-core\/config \u76ee\u9304\u4e0b\u3002<\/p>\r\n\r\n\r\n\r\n<p><img decoding=\"async\" width=\"600\" height=\"204\" class=\"wp-image-925 lazyload\" style=\"--smush-placeholder-width: 600px; --smush-placeholder-aspect-ratio: 600\/204;width: 600px;\" data-src=\"https:\/\/cychien.tw\/wordpress\/wp-content\/uploads\/2021\/12\/04.node_.js.ssl_.path_.png\" alt=\"\" data-srcset=\"https:\/\/cychien.tw\/wordpress\/wp-content\/uploads\/2021\/12\/04.node_.js.ssl_.path_.png 922w, https:\/\/cychien.tw\/wordpress\/wp-content\/uploads\/2021\/12\/04.node_.js.ssl_.path_-300x102.png 300w, https:\/\/cychien.tw\/wordpress\/wp-content\/uploads\/2021\/12\/04.node_.js.ssl_.path_-768x262.png 768w\" data-sizes=\"(max-width: 600px) 100vw, 600px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" \/><\/p>\r\n\r\n\r\n\r\n<p>\u518d\u6253\u958b\u4f86\u770b\u770b\u9019\u5169\u500b\u6191\u8b49\u6a94\u6848\u770b\u770b\u5230\u5e95\u662f\u7528\u54ea\u7a2e\u683c\u5f0f(PEM \u6216\u662f DER)\uff1f\u770b\u8d77\u4f86\u5c31\u662f\u4e00\u822c\u6700\u666e\u904d\u7684 PEM \u683c\u5f0f\uff0c\u525b\u597d Synology \u532f\u51fa\u7684\u6191\u8b49\u683c\u5f0f\u4e5f\u5c31\u662f PEM \u683c\u5f0f\uff0c\u90a3\u5c31\u592a\u5b8c\u7f8e\u4e86\uff0c\u53ef\u4ee5\u7701\u7565 openssl \u8f49\u63db DER \u683c\u5f0f\uff0c\u76f4\u63a5\u66f4\u63db\u6a94\u6848\u5c31\u597d\u3002<\/p>\r\n\r\n\r\n\r\n<p><img decoding=\"async\" width=\"600\" height=\"454\" class=\"wp-image-926 lazyload\" style=\"--smush-placeholder-width: 600px; --smush-placeholder-aspect-ratio: 600\/454;width: 600px;\" data-src=\"https:\/\/cychien.tw\/wordpress\/wp-content\/uploads\/2021\/12\/05.certificate.format.png\" alt=\"\" data-srcset=\"https:\/\/cychien.tw\/wordpress\/wp-content\/uploads\/2021\/12\/05.certificate.format.png 922w, https:\/\/cychien.tw\/wordpress\/wp-content\/uploads\/2021\/12\/05.certificate.format-300x227.png 300w, https:\/\/cychien.tw\/wordpress\/wp-content\/uploads\/2021\/12\/05.certificate.format-768x581.png 768w\" data-sizes=\"(max-width: 600px) 100vw, 600px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" \/><\/p>\r\n\r\n\r\n\r\n<p>\u91cd\u65b0\u555f\u52d5 CloudKey \u6e2c\u8a66\u770b\u770b\uff0c\u679c\u7136\u4e00\u5207\u5b8c\u7f8e\u4e86\u3002<\/p>\r\n\r\n\r\n\r\n<p><img decoding=\"async\" width=\"600\" height=\"578\" class=\"wp-image-927 lazyload\" style=\"--smush-placeholder-width: 600px; --smush-placeholder-aspect-ratio: 600\/578;width: 600px;\" data-src=\"https:\/\/cychien.tw\/wordpress\/wp-content\/uploads\/2021\/12\/06.certificate.valid_.png\" alt=\"\" data-srcset=\"https:\/\/cychien.tw\/wordpress\/wp-content\/uploads\/2021\/12\/06.certificate.valid_.png 919w, https:\/\/cychien.tw\/wordpress\/wp-content\/uploads\/2021\/12\/06.certificate.valid_-300x289.png 300w, https:\/\/cychien.tw\/wordpress\/wp-content\/uploads\/2021\/12\/06.certificate.valid_-768x740.png 768w\" data-sizes=\"(max-width: 600px) 100vw, 600px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" \/><\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>\u7e7c\u4e0a\u7bc7\u6587\u7ae0 \u5728UniFi Controller\u5982\u4f55\u532f\u5165LetsEncrypt\u7c3d\u7f72\u7684\u6191\u8b49\uff1f\uff0c\u6c92\u60f3\u5230\u5f88\u5feb\u5c31\u5728\u7db2\u8def\u793e [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":927,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[109,98,99,111,100,110],"class_list":["post-921","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ittech-network-ubiquiti","tag-cloudkey-gen-2-plus","tag-letsencrypt","tag-ubiquiti","tag-uck-g2-plus","tag-unifi-controller","tag-unifi-network"],"_links":{"self":[{"href":"https:\/\/cychien.tw\/wordpress\/wp-json\/wp\/v2\/posts\/921","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cychien.tw\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cychien.tw\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cychien.tw\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cychien.tw\/wordpress\/wp-json\/wp\/v2\/comments?post=921"}],"version-history":[{"count":4,"href":"https:\/\/cychien.tw\/wordpress\/wp-json\/wp\/v2\/posts\/921\/revisions"}],"predecessor-version":[{"id":931,"href":"https:\/\/cychien.tw\/wordpress\/wp-json\/wp\/v2\/posts\/921\/revisions\/931"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cychien.tw\/wordpress\/wp-json\/wp\/v2\/media\/927"}],"wp:attachment":[{"href":"https:\/\/cychien.tw\/wordpress\/wp-json\/wp\/v2\/media?parent=921"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cychien.tw\/wordpress\/wp-json\/wp\/v2\/categories?post=921"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cychien.tw\/wordpress\/wp-json\/wp\/v2\/tags?post=921"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}