{"id":1675,"date":"2022-12-18T10:35:39","date_gmt":"2022-12-18T10:35:39","guid":{"rendered":"https:\/\/thecloudwiki.com\/?p=1675"},"modified":"2023-02-18T14:06:28","modified_gmt":"2023-02-18T14:06:28","slug":"lets-encrypt-generate-ssl-wildcard-certificate-for-a-domain","status":"publish","type":"post","link":"https:\/\/thecloudwiki.com\/?p=1675","title":{"rendered":"(Horizon HomeLab) Let&#8217;s Encrypt  &#8211; Generate SSL WildCard Certificate for a domain"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">In this article lets&#8217; discuss on how to generate ssl certificates for a website<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In Horizon Cloud in 3 places we need the certificates <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Pod Certificates <\/li>\n\n\n\n<li>UAG certificates<\/li>\n\n\n\n<li>Universal broker certificates<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Pod certificates can be created as self signed since we won&#8217;t directly connect to POD Load balancer also this will be used for Workspace One access trust<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When you deploy UAG for external use &#8211; if we use self signed certs browser always gives certificate error<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you would like to choose UB custom URL then you have to upload custom domain certificates <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For homelabs, by using let&#8217;s encrypt we can avoid the extra cost for purchasing certs , <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To generate the SSL certificate , I will be using Let&#8217;s Encrypt&#8217;s Certbot<br>To know more about how Let&#8217;s Encrypt &amp; Cerbot works , please visit the below pages<br><br><a href=\"https:\/\/letsencrypt.org\/docs\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">https:\/\/letsencrypt.org\/docs\/<\/a><br><a href=\"https:\/\/certbot.eff.org\/pages\/about\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">https:\/\/certbot.eff.org\/pages\/about<\/a><\/p>\n\n\n\n<h2 class=\"has-large-font-size wp-block-heading\" style=\"font-style:normal;font-weight:700;text-transform:capitalize\"><strong><span style=\"text-decoration: underline\" class=\"underline\">Steps to generate certificate <\/span><\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><span style=\"text-decoration: underline\" class=\"underline\">Step : 1<\/span><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">apt-get update\napt-get install python3\n\n\n#To check whether Python or git installed use below commands\n\npython3 --version\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><span style=\"text-decoration: underline\" class=\"underline\">Step: 2<\/span><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt-get install letsencrypt<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><span style=\"text-decoration: underline\" class=\"underline\">Step- 3<\/span><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo certbot certonly --manual --preferred-challenges=dns --email xxxxxxx@gmail.com --server https:\/\/acme-v02.api.letsencrypt.org\/directory --agree-tos -d thecloudwiki.com -d *.thecloudwiki.com\n\nor\n\nsudo certbot certonly \\\n--manual \\ \n--preferred-challenges=dns \\ \n--email xxxxxxxx@gmail.com \\\n--server https:\/\/acme-v02.api.letsencrypt.org\/directory \\\n--agree-tos -d thecloudwiki.com -d *.thecloudwiki.com\n\n#by default since the generated certificate key will be ECDSA , some of the web servers won't accept it , we have to change the algorithm to RSA in most of the cases\n\n--manual \\ \n--preferred-challenges=dns \\ \n--email xxxxxxxx@gmail.com \\\n --key-type rsa \\\n--server https:\/\/acme-v02.api.letsencrypt.org\/directory \\\n--agree-tos -d thecloudwiki.com -d *.thecloudwiki.com\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">When you see &#8221; <em>Press Enter to Continue<\/em>&#8221; &#8211; please don&#8217;t hit on Enter till you create the TXT record in step- 4 <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example : <br><img loading=\"lazy\" decoding=\"async\" width=\"1800\" height=\"429\" class=\"wp-image-1676\" style=\"width: 1800px;\" src=\"https:\/\/thecloudwiki.com\/wp-content\/uploads\/2022\/12\/certbot01.png\" alt=\"\" srcset=\"https:\/\/thecloudwiki.com\/wp-content\/uploads\/2022\/12\/certbot01.png 1855w, https:\/\/thecloudwiki.com\/wp-content\/uploads\/2022\/12\/certbot01-300x71.png 300w, https:\/\/thecloudwiki.com\/wp-content\/uploads\/2022\/12\/certbot01-1024x244.png 1024w, https:\/\/thecloudwiki.com\/wp-content\/uploads\/2022\/12\/certbot01-768x183.png 768w, https:\/\/thecloudwiki.com\/wp-content\/uploads\/2022\/12\/certbot01-1536x366.png 1536w\" sizes=\"auto, (max-width: 1800px) 100vw, 1800px\" \/><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><span style=\"text-decoration: underline\" class=\"underline\">Step: 4<\/span><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Login to your account from where you registered the domain ( in my case it&#8217;s godaddy)<br><br><img loading=\"lazy\" decoding=\"async\" width=\"1500\" height=\"265\" class=\"wp-image-1677\" style=\"width: 1500px;\" src=\"https:\/\/thecloudwiki.com\/wp-content\/uploads\/2022\/12\/certbot02.png\" alt=\"\" srcset=\"https:\/\/thecloudwiki.com\/wp-content\/uploads\/2022\/12\/certbot02.png 1684w, https:\/\/thecloudwiki.com\/wp-content\/uploads\/2022\/12\/certbot02-300x53.png 300w, https:\/\/thecloudwiki.com\/wp-content\/uploads\/2022\/12\/certbot02-1024x181.png 1024w, https:\/\/thecloudwiki.com\/wp-content\/uploads\/2022\/12\/certbot02-768x135.png 768w, https:\/\/thecloudwiki.com\/wp-content\/uploads\/2022\/12\/certbot02-1536x271.png 1536w\" sizes=\"auto, (max-width: 1500px) 100vw, 1500px\" \/><br><br><img loading=\"lazy\" decoding=\"async\" width=\"1500\" height=\"416\" class=\"wp-image-1678\" style=\"width: 1500px;\" src=\"https:\/\/thecloudwiki.com\/wp-content\/uploads\/2022\/12\/certbot03.png\" alt=\"\" srcset=\"https:\/\/thecloudwiki.com\/wp-content\/uploads\/2022\/12\/certbot03.png 1616w, https:\/\/thecloudwiki.com\/wp-content\/uploads\/2022\/12\/certbot03-300x83.png 300w, https:\/\/thecloudwiki.com\/wp-content\/uploads\/2022\/12\/certbot03-1024x284.png 1024w, https:\/\/thecloudwiki.com\/wp-content\/uploads\/2022\/12\/certbot03-768x213.png 768w, https:\/\/thecloudwiki.com\/wp-content\/uploads\/2022\/12\/certbot03-1536x426.png 1536w\" sizes=\"auto, (max-width: 1500px) 100vw, 1500px\" \/><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now use the google toolbox to check to verify the challenge <br><br><strong>https:\/\/toolbox.googleapps.com\/apps\/dig\/#TXT\/<em>&lt;copy the info of &#8216;Please deploy a DNS TXT record under the name&#8217; from Step-3&gt;<\/em><\/strong><br><br>in my case I will launch the URL as &#8211;<strong> https:\/\/toolbox.googleapps.com\/apps\/dig\/#TXT\/_acme-challenge.thecloudwiki.com <\/strong><br><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once you see the challenge that you have entered in the DNS provider website like below , go ahead and click on enter on certbot certificate creation page <br><br><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"500\" class=\"wp-image-1679\" style=\"width: 1200px;\" src=\"https:\/\/thecloudwiki.com\/wp-content\/uploads\/2022\/12\/certbot04.png\" alt=\"\" srcset=\"https:\/\/thecloudwiki.com\/wp-content\/uploads\/2022\/12\/certbot04.png 1768w, https:\/\/thecloudwiki.com\/wp-content\/uploads\/2022\/12\/certbot04-300x125.png 300w, https:\/\/thecloudwiki.com\/wp-content\/uploads\/2022\/12\/certbot04-1024x426.png 1024w, https:\/\/thecloudwiki.com\/wp-content\/uploads\/2022\/12\/certbot04-768x320.png 768w, https:\/\/thecloudwiki.com\/wp-content\/uploads\/2022\/12\/certbot04-1536x639.png 1536w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><br><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><span style=\"text-decoration: underline\" class=\"underline\">Step- 5<\/span><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If the certificate creation is success then you see the below message on the terminal <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nPress Enter to Continue\n\nSuccessfully received certificate.\nCertificate is saved at: \/etc\/letsencrypt\/live\/hcsdevops.com\/fullchain.pem\nKey is saved at:         \/etc\/letsencrypt\/live\/hcsdevops.com\/privkey.pem\nThis certificate expires on 2023-03-18.\nThese files will be updated when the certificate renews.\n\nNEXT STEPS:\n- This certificate will not be renewed automatically. Autorenewal of --manual certificates requires the use of an authentication hook script (--manual-auth-hook) but one was not provided. To renew this certificate, repeat this same certbot command before the certificate's expiry date.\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nIf you like Certbot, please consider supporting our work by:\n * Donating to ISRG \/ Let's Encrypt:   https:\/\/letsencrypt.org\/donate\n * Donating to EFF:                    https:\/\/eff.org\/donate-le\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Example :<br><br><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"439\" class=\"wp-image-1680\" style=\"width: 1200px;\" src=\"https:\/\/thecloudwiki.com\/wp-content\/uploads\/2022\/12\/certbot05.png\" alt=\"\" srcset=\"https:\/\/thecloudwiki.com\/wp-content\/uploads\/2022\/12\/certbot05.png 1908w, https:\/\/thecloudwiki.com\/wp-content\/uploads\/2022\/12\/certbot05-300x110.png 300w, https:\/\/thecloudwiki.com\/wp-content\/uploads\/2022\/12\/certbot05-1024x375.png 1024w, https:\/\/thecloudwiki.com\/wp-content\/uploads\/2022\/12\/certbot05-768x281.png 768w, https:\/\/thecloudwiki.com\/wp-content\/uploads\/2022\/12\/certbot05-1536x562.png 1536w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/> <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><span style=\"text-decoration: underline\" class=\"underline\">Step: 6<\/span><\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># you can view the generated certificates here \n\nroot@LINUX01:~\/certbot# certbot certificates\nSaving debug log to \/var\/log\/letsencrypt\/letsencrypt.log\n\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nFound the following certs:\n  Certificate Name: thecloudwiki.com\n    Serial Number: 485axxxxxx866e5850xxxxxxxx44\n    Key Type: ECDSA\n    Domains: thecloudwiki.com *.thecloudwiki.com\n    Expiry Date: 2023-03-18 09:06:49+00:00 (VALID: 89 days)\n    Certificate Path: \/etc\/letsencrypt\/live\/thecloudwiki.com\/fullchain.pem\n    Private Key Path: \/etc\/letsencrypt\/live\/thecloudwiki.com\/privkey.pem\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><br><strong><span style=\"text-decoration: underline\" class=\"underline\">Step: 7 <\/span><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Since the above generated certificate is valid only for 89 days , you can use below command to renew the same <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">certbot certonly --manual --server https:\/\/acme-v02.api.letsencrypt.org\/directory -d thecloudwiki.com -d *.thecloudwiki.com\n\n#for RSA renew \n\ncertbot certonly --manual --server https:\/\/acme-v02.api.letsencrypt.org\/directory  --key-type rsa -d thecloudwiki.com -d *.thecloudwiki.com<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Copy the certs from the <strong><span style=\"text-decoration: underline\" class=\"underline\">Step-6<\/span><\/strong> and upload to UAG&#8217;s &amp; Universal Broker<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article lets&#8217; discuss on how to generate ssl [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1703,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","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":"","ast-disable-related-posts":"","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":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"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-opacity":"","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-opacity":"","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-opacity":"","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-opacity":"","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-opacity":"","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-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[25,21],"tags":[17,13],"class_list":["post-1675","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-horizon","tag-linux","tag-horizon"],"uagb_featured_image_src":{"full":["https:\/\/thecloudwiki.com\/wp-content\/uploads\/2022\/12\/Lets-Encrypt-e1676728639769.png",200,258,false],"thumbnail":["https:\/\/thecloudwiki.com\/wp-content\/uploads\/2022\/12\/Lets-Encrypt-e1676728639769-150x150.png",150,150,true],"medium":["https:\/\/thecloudwiki.com\/wp-content\/uploads\/2022\/12\/Lets-Encrypt-232x300.png",232,300,true],"medium_large":["https:\/\/thecloudwiki.com\/wp-content\/uploads\/2022\/12\/Lets-Encrypt-768x991.png",768,991,true],"large":["https:\/\/thecloudwiki.com\/wp-content\/uploads\/2022\/12\/Lets-Encrypt-793x1024.png",793,1024,true],"1536x1536":["https:\/\/thecloudwiki.com\/wp-content\/uploads\/2022\/12\/Lets-Encrypt-e1676728639769.png",200,258,false],"2048x2048":["https:\/\/thecloudwiki.com\/wp-content\/uploads\/2022\/12\/Lets-Encrypt-e1676728639769.png",200,258,false]},"uagb_author_info":{"display_name":"Sandeep","author_link":"https:\/\/thecloudwiki.com\/?author=1"},"uagb_comment_info":0,"uagb_excerpt":"In this article lets&#8217; discuss on how to generate ssl [&hellip;]","_links":{"self":[{"href":"https:\/\/thecloudwiki.com\/index.php?rest_route=\/wp\/v2\/posts\/1675","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thecloudwiki.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thecloudwiki.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thecloudwiki.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thecloudwiki.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1675"}],"version-history":[{"count":3,"href":"https:\/\/thecloudwiki.com\/index.php?rest_route=\/wp\/v2\/posts\/1675\/revisions"}],"predecessor-version":[{"id":1704,"href":"https:\/\/thecloudwiki.com\/index.php?rest_route=\/wp\/v2\/posts\/1675\/revisions\/1704"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thecloudwiki.com\/index.php?rest_route=\/wp\/v2\/media\/1703"}],"wp:attachment":[{"href":"https:\/\/thecloudwiki.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1675"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thecloudwiki.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1675"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thecloudwiki.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1675"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}