{"id":191,"date":"2024-02-14T18:30:03","date_gmt":"2024-02-14T17:30:03","guid":{"rendered":"https:\/\/leren.ovh\/?p=191"},"modified":"2024-02-15T10:53:52","modified_gmt":"2024-02-15T09:53:52","slug":"lets-encrypt-for-proxmox","status":"publish","type":"post","link":"https:\/\/leren.ovh\/index.php\/2024\/02\/14\/lets-encrypt-for-proxmox\/","title":{"rendered":"Let&#8217;s Encrypt for Proxmox"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">In order to no longer get the message that your certificate is invalid (SelfSigned Certificate made during installation) when connecting to the ProxMox Virtual Environment (PVE), a certificate from an official instance is required.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The one used here is Let&#8217;s Encrypt as the certificates  are free and can be automated. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The automation can be done either by posting a special webpage (HTTP) on a website corresponding to the domain for which you want to have a certificate. This is not the method used here as this requires a website accessible from the internet.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The other method is where Let&#8217;s Encrypt wants you to show control over a domain name by creating a DNS-record with a special content. This does not require a website on the internet. This will be the method used here. Once control is shown the certificate will be created. All of this is done by<strong> <\/strong>the &#8220;Automatic Certificate Management Environment&#8221; (ACME) of Let&#8217;s Encrypt<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Create 2 Accounts for ACME : Staging (test) and Production <br>Connect to the Proxmox Machine -&gt;DataCenter -&gt; ACME -&gt; Add Account<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"926\" src=\"https:\/\/leren.ovh\/wp-content\/uploads\/2024\/02\/2023-04-09_19-07-51-1024x926.jpg\" alt=\"\" class=\"wp-image-197\" style=\"width:503px;height:auto\" srcset=\"https:\/\/leren.ovh\/wp-content\/uploads\/2024\/02\/2023-04-09_19-07-51-1024x926.jpg 1024w, https:\/\/leren.ovh\/wp-content\/uploads\/2024\/02\/2023-04-09_19-07-51-300x271.jpg 300w, https:\/\/leren.ovh\/wp-content\/uploads\/2024\/02\/2023-04-09_19-07-51-768x695.jpg 768w, https:\/\/leren.ovh\/wp-content\/uploads\/2024\/02\/2023-04-09_19-07-51.jpg 1444w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"946\" height=\"538\" src=\"https:\/\/leren.ovh\/wp-content\/uploads\/2024\/02\/2023-04-09_19-11-12.jpg\" alt=\"\" class=\"wp-image-199\" style=\"width:346px;height:auto\" srcset=\"https:\/\/leren.ovh\/wp-content\/uploads\/2024\/02\/2023-04-09_19-11-12.jpg 946w, https:\/\/leren.ovh\/wp-content\/uploads\/2024\/02\/2023-04-09_19-11-12-300x171.jpg 300w, https:\/\/leren.ovh\/wp-content\/uploads\/2024\/02\/2023-04-09_19-11-12-768x437.jpg 768w\" sizes=\"auto, (max-width: 946px) 100vw, 946px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"970\" height=\"548\" src=\"https:\/\/leren.ovh\/wp-content\/uploads\/2024\/02\/2023-04-09_20-01-11.jpg\" alt=\"\" class=\"wp-image-200\" style=\"width:343px;height:auto\" srcset=\"https:\/\/leren.ovh\/wp-content\/uploads\/2024\/02\/2023-04-09_20-01-11.jpg 970w, https:\/\/leren.ovh\/wp-content\/uploads\/2024\/02\/2023-04-09_20-01-11-300x169.jpg 300w, https:\/\/leren.ovh\/wp-content\/uploads\/2024\/02\/2023-04-09_20-01-11-768x434.jpg 768w\" sizes=\"auto, (max-width: 970px) 100vw, 970px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"573\" src=\"https:\/\/leren.ovh\/wp-content\/uploads\/2024\/02\/2023-04-09_19-22-40-1024x573.jpg\" alt=\"\" class=\"wp-image-201\" style=\"width:418px;height:auto\" srcset=\"https:\/\/leren.ovh\/wp-content\/uploads\/2024\/02\/2023-04-09_19-22-40-1024x573.jpg 1024w, https:\/\/leren.ovh\/wp-content\/uploads\/2024\/02\/2023-04-09_19-22-40-300x168.jpg 300w, https:\/\/leren.ovh\/wp-content\/uploads\/2024\/02\/2023-04-09_19-22-40-768x430.jpg 768w, https:\/\/leren.ovh\/wp-content\/uploads\/2024\/02\/2023-04-09_19-22-40.jpg 1294w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">2. My DNS-Provider is OVH and they have a DNS-plugin for the ACME process. You will need an Application Key (OVH_AK) and Application Secret (OVH_AS) and if this is a new one, it will also need to  be authorized. Which will result in a customer key (OVH_CK). The endpoint in my case is ovh-eu. If you already have these keys (Token), you can fill this in here and proceed to step 4. Be warned though: it is best (for security reasons) to have a Token limited to only DNS-Control of your domain. Don&#8217;t use one for your entire OVH-Account.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"513\" src=\"https:\/\/leren.ovh\/wp-content\/uploads\/2024\/02\/acme-dns-ovh-1024x513.jpg\" alt=\"\" class=\"wp-image-204\" style=\"width:424px;height:auto\" srcset=\"https:\/\/leren.ovh\/wp-content\/uploads\/2024\/02\/acme-dns-ovh-1024x513.jpg 1024w, https:\/\/leren.ovh\/wp-content\/uploads\/2024\/02\/acme-dns-ovh-300x150.jpg 300w, https:\/\/leren.ovh\/wp-content\/uploads\/2024\/02\/acme-dns-ovh-768x385.jpg 768w, https:\/\/leren.ovh\/wp-content\/uploads\/2024\/02\/acme-dns-ovh.jpg 1082w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">3. In order to get an API Key from OVH. You can follow the documentation at <br>https:\/\/github.com\/acmesh-official\/acme.sh\/wiki\/How-to-use-OVH-domain-api<br>In short you will ask for a token limited to your domain.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>https:\/\/api.ovh.com\/createToken\/?GET=\/domain\/zone\/mydomain.com\/<em>&amp;POST=\/domain\/zone\/mydomain.com\/<\/em>&amp;PUT=\/domain\/zone\/mydomain.com\/<em>&amp;GET=\/domain\/zone\/mydomain.com&amp;DELETE=\/domain\/zone\/mydomain.com\/record\/<\/em><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This will give you something similar to below. You will need to login to your OVH-account if you weren&#8217;t already.<br><\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"710\" height=\"1024\" src=\"https:\/\/leren.ovh\/wp-content\/uploads\/2024\/02\/ovh-cloud-api-710x1024.jpg\" alt=\"\" class=\"wp-image-209\" style=\"width:345px;height:auto\" srcset=\"https:\/\/leren.ovh\/wp-content\/uploads\/2024\/02\/ovh-cloud-api-710x1024.jpg 710w, https:\/\/leren.ovh\/wp-content\/uploads\/2024\/02\/ovh-cloud-api-208x300.jpg 208w, https:\/\/leren.ovh\/wp-content\/uploads\/2024\/02\/ovh-cloud-api-768x1108.jpg 768w, https:\/\/leren.ovh\/wp-content\/uploads\/2024\/02\/ovh-cloud-api.jpg 940w\" sizes=\"auto, (max-width: 710px) 100vw, 710px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Once given a proper name and description, change the validity to unlimited and Create the Key. For obvious reasons, I will not show the resulting keys here.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can now fill in the Application Key, Application Secret and Endpoint. The Customer Key is still missing. But this will be adapted later.<br><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">4. You can now go order your Certificates.<br>Connect to your Proxmox System and select Certificates.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"128\" src=\"http:\/\/leren.ovh\/wp-content\/uploads\/2024\/02\/proxmox-certificates-ACME-1024x128.jpg\" alt=\"\" class=\"wp-image-212\" srcset=\"https:\/\/leren.ovh\/wp-content\/uploads\/2024\/02\/proxmox-certificates-ACME-1024x128.jpg 1024w, https:\/\/leren.ovh\/wp-content\/uploads\/2024\/02\/proxmox-certificates-ACME-300x38.jpg 300w, https:\/\/leren.ovh\/wp-content\/uploads\/2024\/02\/proxmox-certificates-ACME-768x96.jpg 768w, https:\/\/leren.ovh\/wp-content\/uploads\/2024\/02\/proxmox-certificates-ACME.jpg 1151w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><br>Make sure Staging is selected and applied and click on Order Certificates Now.<br>If you used an API key that was already approved then it should simply work and you will get a message similar to this ending in<br><em>All domains validated!<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Creating CSR<br>Checking order status<br>Order is ready, finalizing order<br>valid!<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Downloading certificate<br>Setting pveproxy certificate and key<br>Restarting pveproxy<br>TASK OK<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If this was the first time you used this API Key you will need to authorize it. A request must be done. The following will be visible in the resulting code.<br><em>OVH consumer key is empty, Let&#8217;s get one:<br>Please open this link to do authentication: https:\/\/eu.api.ovh.com\/auth\/?credentialToken=n0Qbjm6wBdBr2KiSqIuYSEnixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx<br>Here is a guide for you: https:\/\/github.com\/Neilpang\/acme.sh\/wiki\/How-to-use-OVH-domain-api<br>Please retry after the authentication is done.<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You should simply open the link as mentioned. This should authorize it and the next run should work now.<br>If this works now you should have a staging certificate on your system installed. Closing your browser might be needed to make sure nothing was cached.<br>If all this works out, you can now change the order to Production: Apply and Order Certificates Now for production and you should have a good certificate. A new browser session might be required<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In order to no longer get the message that your certificate is invalid (SelfSigned Certificate made during installation) when connecting to the ProxMox Virtual Environment (PVE), a certificate from an official instance is required. The one used here is Let&#8217;s Encrypt as the certificates are free and can be automated. The automation can be done&hellip;&nbsp;<a href=\"https:\/\/leren.ovh\/index.php\/2024\/02\/14\/lets-encrypt-for-proxmox\/\" class=\"\" rel=\"bookmark\">Read More &raquo;<span class=\"screen-reader-text\">Let&#8217;s Encrypt for Proxmox<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","_themeisle_gutenberg_block_has_review":false,"_ti_tpc_template_sync":false,"_ti_tpc_template_id":"","footnotes":""},"categories":[20],"tags":[21,19],"class_list":["post-191","post","type-post","status-publish","format-standard","hentry","category-proxmox","tag-lets-encrypt","tag-proxmox"],"_links":{"self":[{"href":"https:\/\/leren.ovh\/index.php\/wp-json\/wp\/v2\/posts\/191","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/leren.ovh\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/leren.ovh\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/leren.ovh\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/leren.ovh\/index.php\/wp-json\/wp\/v2\/comments?post=191"}],"version-history":[{"count":10,"href":"https:\/\/leren.ovh\/index.php\/wp-json\/wp\/v2\/posts\/191\/revisions"}],"predecessor-version":[{"id":217,"href":"https:\/\/leren.ovh\/index.php\/wp-json\/wp\/v2\/posts\/191\/revisions\/217"}],"wp:attachment":[{"href":"https:\/\/leren.ovh\/index.php\/wp-json\/wp\/v2\/media?parent=191"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/leren.ovh\/index.php\/wp-json\/wp\/v2\/categories?post=191"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/leren.ovh\/index.php\/wp-json\/wp\/v2\/tags?post=191"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}