{"id":371,"date":"2025-01-20T21:42:02","date_gmt":"2025-01-20T13:42:02","guid":{"rendered":"https:\/\/daogu.work\/?p=371"},"modified":"2025-01-20T21:42:02","modified_gmt":"2025-01-20T13:42:02","slug":"pve%e4%bf%ae%e6%94%b9ssl%e8%af%81%e4%b9%a6%e6%ad%a5%e9%aa%a4%e5%8f%8a%e8%b8%a9%e5%9d%91%e6%8f%90%e9%86%92","status":"publish","type":"post","link":"https:\/\/daogu.work\/?p=371","title":{"rendered":"PVE\u4fee\u6539SSL\u8bc1\u4e66\u6b65\u9aa4\u53ca\u8e29\u5751\u63d0\u9192"},"content":{"rendered":"\n<p>\u56e0\u4e3a\u65e7\u7684\u96f6\u523b\u673a\u5b50\u7ec8\u4e8e\u9000\u5f79\u4e86\uff0c\u6211\u51b3\u5b9a\u5c06\u5907\u7528\u7684 PVE \u670d\u52a1\u5668\u6276\u6b63\uff0c\u5e76\u5c06\u57df\u540d\u6307\u5411\u65b0\u673a\u5b50\u3002<br>\u4ee5\u4e0b\u662f\u4fee\u6539 SSL \u8bc1\u4e66\u7684\u8be6\u7ec6\u6b65\u9aa4\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u6b65\u9aa4\u4e00\uff1a\u5c06 crt \u8bc1\u4e66\u8f6c\u4e3a pem \u8bc1\u4e66<\/h2>\n\n\n\n<p>\u9996\u5148\uff0c\u4f60\u9700\u8981\u5c06\u4f60\u7684 <code>crt<\/code> \u683c\u5f0f\u8bc1\u4e66\u8f6c\u6362\u4e3a <code>pem<\/code> \u683c\u5f0f\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>openssl x509 -in your.domain.crt -out your.domain.pem -outform PEM<\/code><\/pre>\n\n\n\n<p>\u68c0\u67e5\u4e00\u4e0bPEM\u8bc1\u4e66\u662f\u5426\u6709\u6548\u548c\u7b26\u5408\u671f\u671b\uff0c\u5982\u679c\u6b63\u5e38\u8f93\u51fa\u5185\u5bb9\uff0c\u5219\u8bc1\u660e\u8bc1\u4e66\u8f6c\u6362\u6210\u529f\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>openssl x509 -in your.domain.pem -text -noout<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u6b65\u9aa4\u4e8c\uff1a\u786e\u5b9a\u8282\u70b9\u540d\u79f0<\/h2>\n\n\n\n<p>\u8981\u786e\u4fdd\u4f60\u64cd\u4f5c\u7684\u662f\u6b63\u786e\u7684\u8282\u70b9\uff0c\u9996\u5148\u68c0\u67e5\u5f53\u524d\u8282\u70b9\u540d\u79f0\u3002\u4e00\u822c\u60c5\u51b5\u4e0b\uff0c\u8282\u70b9\u540d\u79f0\u53ef\u4ee5\u901a\u8fc7 <code>\/etc\/hostname<\/code> \u6587\u4ef6\u67e5\u770b\u3002\u4f60\u4e5f\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u786e\u5b9a\u8282\u70b9\u8def\u5f84\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/etc\/pve\/nodes\/$(cat \/etc\/hostname)\npwd<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u6b65\u9aa4\u4e09\uff1a\u5907\u4efd\u5e76\u5bfc\u5165\u8bc1\u4e66<\/h2>\n\n\n\n<p>\u5728\u66ff\u6362\u8bc1\u4e66\u524d\uff0c\u5efa\u8bae\u5148\u5907\u4efd\u539f\u6709\u7684\u8bc1\u4e66\u6587\u4ef6 <code>pveproxy-ssl.pem<\/code> \u548c <code>pveproxy-ssl.key<\/code>\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cp \/etc\/pve\/nodes\/$(cat \/etc\/hostname)\/pveproxy-ssl.pem \/etc\/pve\/nodes\/$(cat \/etc\/hostname)\/pveproxy-ssl.pem.bak\ncp \/etc\/pve\/nodes\/$(cat \/etc\/hostname)\/pveproxy-ssl.key \/etc\/pve\/nodes\/$(cat \/etc\/hostname)\/pveproxy-ssl.key.bak<\/code><\/pre>\n\n\n\n<p>\u7136\u540e\uff0c\u5c06\u65b0\u7684\u8bc1\u4e66\u548c\u79c1\u94a5\u590d\u5236\u5230\u76f8\u5e94\u76ee\u5f55\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cp your.domain.pem \/etc\/pve\/nodes\/$(cat \/etc\/hostname)\/pveproxy-ssl.pem\ncp your.domain.key \/etc\/pve\/nodes\/$(cat \/etc\/hostname)\/pveproxy-ssl.key<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u6b65\u9aa4\u56db\uff1a\u91cd\u542f\u670d\u52a1<\/h2>\n\n\n\n<p>\u66ff\u6362\u8bc1\u4e66\u540e\uff0c\u9700\u8981\u91cd\u542f <code>pveproxy<\/code> \u670d\u52a1\uff0c\u4ee5\u4f7f\u66f4\u6539\u751f\u6548\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl restart pveproxy<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u6b65\u9aa4\u4e94\uff1a\u57df\u540d\u914d\u7f6e<\/h2>\n\n\n\n<p>\u81f3\u6b64\uff0c\u8bc1\u4e66\u5df2\u7ecf\u66ff\u6362\u5b8c\u6210\u3002\u4f46\u4e3a\u4e86\u5b9e\u73b0\u901a\u8fc7\u57df\u540d\u8bbf\u95ee PVE\uff0c\u8fd8\u9700\u8981\u5728\u8def\u7531\u5668\u4e0a\u914d\u7f6e\u76f8\u5e94\u7684 DNS \u8bbe\u7f6e\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u8e29\u5751\u63d0\u9192<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u4e0d\u9700\u8981\u4fee\u6539 <code>\/etc\/hostname<\/code> \u548c <code>\/etc\/hosts<\/code> \u914d\u7f6e\u6587\u4ef6<\/strong>\uff1a\u6539\u4e86\u4e4b\u540e\u53ef\u80fd\u51fa\u73b0\u865a\u62df\u673a\u65e0\u6cd5\u8bbf\u95ee\u7684\u60c5\u51b5\u3002<\/li>\n\n\n\n<li><strong>\u4e0d\u8981\u4e0a\u4f20CA\u6839\u8bc1\u4e66<\/strong>\uff1a\u5982\u679c\u4f7f\u7528\u7684\u662f\u56fe\u5f62\u754c\u9762\uff0c\u907f\u514d\u4e0a\u4f20\u6839\u8bc1\u4e66\u3002PVE \u7684\u8bc1\u4e66\u914d\u7f6e\u53ea\u9700\u8981\u66ff\u6362\u5bf9\u5e94\u8282\u70b9\u7684\u8bc1\u4e66\uff0c\u4e0d\u9700\u8981\u4fee\u6539\u6839\u8bc1\u4e66\u3002<\/li>\n\n\n\n<li><strong>\u4e0d\u8981\u4fee\u6539 <code>pve-ssl.pem<\/code> \u548c <code>pve-ssl.key<\/code> \u8bc1\u4e66<\/strong>\uff1a\u8fd9\u4e24\u4e2a\u8bc1\u4e66\u7528\u4e8e PVE \u96c6\u7fa4\u901a\u4fe1\uff0c\u4fee\u6539\u540e\u53ef\u80fd\u5bfc\u81f4\u96c6\u7fa4\u95f4\u7684\u901a\u4fe1\u4e2d\u65ad\u3002\u6240\u4ee5\uff0c\u8fd9\u4e24\u4e2a\u8bc1\u4e66\u65e0\u9700\u52a8\uff0c\u4fdd\u6301\u539f\u6837\u5373\u53ef\u3002<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u56e0\u4e3a\u65e7\u7684\u96f6\u523b\u673a\u5b50\u7ec8\u4e8e\u9000\u5f79\u4e86\uff0c\u6211\u51b3\u5b9a\u5c06\u5907\u7528\u7684 PVE \u670d\u52a1\u5668\u6276\u6b63\uff0c\u5e76\u5c06\u57df\u540d\u6307\u5411\u65b0\u673a\u5b50\u3002\u4ee5\u4e0b\u662f\u4fee\u6539 SSL \u8bc1\u4e66\u7684 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[60,207,107],"class_list":["post-371","post","type-post","status-publish","format-standard","hentry","category-softinstall","tag-pve","tag-pveproxy","tag-ssl"],"_links":{"self":[{"href":"https:\/\/daogu.work\/index.php?rest_route=\/wp\/v2\/posts\/371","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/daogu.work\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/daogu.work\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/daogu.work\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/daogu.work\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=371"}],"version-history":[{"count":1,"href":"https:\/\/daogu.work\/index.php?rest_route=\/wp\/v2\/posts\/371\/revisions"}],"predecessor-version":[{"id":372,"href":"https:\/\/daogu.work\/index.php?rest_route=\/wp\/v2\/posts\/371\/revisions\/372"}],"wp:attachment":[{"href":"https:\/\/daogu.work\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=371"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/daogu.work\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=371"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/daogu.work\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=371"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}