{"id":139,"date":"2022-06-25T20:30:06","date_gmt":"2022-06-26T01:30:06","guid":{"rendered":"https:\/\/cloudlearning365.com\/?p=139"},"modified":"2022-10-28T13:22:05","modified_gmt":"2022-10-28T18:22:05","slug":"add-ssl-certificate-to-aviatrix-controller","status":"publish","type":"post","link":"https:\/\/cloudlearning365.com\/?p=139","title":{"rendered":"Add SSL Certificate to Aviatrix Controller"},"content":{"rendered":"\n<p>When first launched Aviatrix controller from marketplace, the Aviatrix controller give itself a self-signed certificate, and you have to use https:\/\/controller-ip to access it, which may not meet compliance requirement.<\/p>\n\n\n\n<p>This blog will talk about getting a public trusted SSL certificate for Aviatrix controller.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>First you will need to own a domain name, there are many <em><a href=\"https:\/\/blog.hubspot.com\/website\/best-domain-registrars\">domain registrar<\/a><\/em> such as <a href=\"https:\/\/www.namecheap.com\/\"><em>NamesCheap<\/em><\/a> that you pay yearly, or <em><a href=\"https:\/\/www.freenom.com\/\">Freenom<\/a><\/em> for free with limited Top Level Domain (TLD) names.<\/p>\n\n\n\n<p>Let&#8217;s say you have obtained your domain name: mydomain.com, and you have decided that to access your controller you would use <strong>https:\/\/avx.mydomain.com<\/strong><\/p>\n\n\n\n<p>Create an A record in DNS provider, so <strong>avx.mydomain.com<\/strong> would point to the Aviatrix Controller public IP.<\/p>\n\n\n\n<p>There are free SSL certificate provider such as <em>LetsEncrypt<\/em> or <em><a href=\"https:\/\/zerossl.com\/\">ZeroSSL<\/a><\/em>, in this blog, I&#8217;m using ZeroSSL to request a certificate for <strong>avx.mydomain.com<\/strong>, as it allows you request certificate directly from Web Page rather than using <em><a href=\"https:\/\/certbot.eff.org\/\">CertBot <\/a><\/em>command line. <\/p>\n\n\n\n<p><strong>NEW<\/strong>! ZeroSSL limits total of three 90 days certificate, expired certificate also counts towards the total. If you need to get certificate frequently, follow this blog to get a free SSL certificate: <a href=\"https:\/\/cloudlearning365.com\/?p=850\">Get a free public SSL certificate for testing environment using Posh-ACME<\/a><\/p>\n\n\n\n<p>After you created an account in ZeroSSL, choose <strong>New Certificate<\/strong><\/p>\n\n\n\n<p>Enter Domains : <strong>avx.mydomain.com<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-1024x576.png\" alt=\"\" class=\"wp-image-141\" srcset=\"https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-1024x576.png 1024w, https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-300x169.png 300w, https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-768x432.png 768w, https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image.png 1353w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>I&#8217;ve picked 90-Day Certificate (Free)<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"514\" src=\"https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-1-1024x514.png\" alt=\"\" class=\"wp-image-142\" srcset=\"https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-1-1024x514.png 1024w, https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-1-300x151.png 300w, https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-1-768x385.png 768w, https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-1.png 1367w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Leaving default to Auto-Generate CSR (Certificate Signing Request)<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"543\" src=\"https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-2-1024x543.png\" alt=\"\" class=\"wp-image-143\" srcset=\"https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-2-1024x543.png 1024w, https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-2-300x159.png 300w, https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-2-768x407.png 768w, https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-2.png 1357w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Stay with Free offer<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"874\" height=\"1024\" src=\"https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-3-874x1024.png\" alt=\"\" class=\"wp-image-144\" srcset=\"https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-3-874x1024.png 874w, https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-3-256x300.png 256w, https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-3-768x900.png 768w, https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-3-1310x1536.png 1310w, https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-3.png 1377w\" sizes=\"auto, (max-width: 874px) 100vw, 874px\" \/><\/figure>\n\n\n\n<p>Next step is to validate that you actually own the domain, if you just setup DNS, you may not have email or web page yet, so I&#8217;ve picked DNS (CNAME) validation. But you are welcome to use email provider such as <em>zoho<\/em> to setup mailbox (will require MX record for email), or create a webpage for file upload (Will require A record for your website)<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"863\" height=\"1024\" src=\"https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-4-863x1024.png\" alt=\"\" class=\"wp-image-145\" srcset=\"https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-4-863x1024.png 863w, https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-4-253x300.png 253w, https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-4-768x912.png 768w, https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-4-1294x1536.png 1294w, https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-4.png 1347w\" sizes=\"auto, (max-width: 863px) 100vw, 863px\" \/><\/figure>\n\n\n\n<p>Goes back to your DNS provider and create the CNAME. DNS can be slow to propagate, after this I would suggest to wait for half an hour, before try <strong>Verify Domain<\/strong> button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"533\" src=\"https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-5-1024x533.png\" alt=\"\" class=\"wp-image-146\" srcset=\"https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-5-1024x533.png 1024w, https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-5-300x156.png 300w, https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-5-768x400.png 768w, https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-5.png 1381w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Once the domain is validated, and the certificate will be issued. You can choose to download the certificate zip file.<\/p>\n\n\n\n<p>The zip file contains three files:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"575\" height=\"191\" src=\"https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-6.png\" alt=\"\" class=\"wp-image-147\" srcset=\"https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-6.png 575w, https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-6-300x100.png 300w\" sizes=\"auto, (max-width: 575px) 100vw, 575px\" \/><\/figure>\n\n\n\n<p><strong>ca_bundle.crt<\/strong>: This file contains <span style=\"text-decoration: underline\">only one intermediate certificate<\/span> (ZeroSSL CA). <\/p>\n\n\n\n<p><strong>certificate.crt<\/strong>: This file contains your primary SSL certificate<\/p>\n\n\n\n<p><strong>private.key<\/strong>: This file contains your private key<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h6 class=\"wp-block-heading\">Note: <\/h6>\n\n\n\n<p><strong>ca_bundle.crt<\/strong> and <strong>certificate.crt<\/strong> are <strong><em>PEM encoded X.509 certificate<\/em><\/strong>, when opens up using text editor, it looks like:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>-----BEGIN CERTIFICATE-----\nMIIGhz...\n...\n...WlLw==\n-----END CERTIFICATE-----<\/code><\/pre>\n\n\n\n<p><strong>private.key<\/strong> is <strong><em>PEM encoded RSA private key<\/em><\/strong>, when opens up using text editor, it looks like:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>-----BEGIN RSA PRIVATE KEY-----\nMIIE...\n...\n...\n-----END RSA PRIVATE KEY-----<\/code><\/pre>\n\n\n\n<p><a href=\"https:\/\/www.ssl.com\/guide\/pem-der-crt-and-cer-x-509-encodings-and-conversions\/\">This article<\/a> is a great read of different type of certificates.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><strong>Note<\/strong>: If you are planning to use Azure Application Gateway to front end your controller, you will need to obtain <em><a href=\"https:\/\/azureaggregator.wordpress.com\/2022\/04\/01\/azure-application-gateway-502-error-due-to-backend-certificate-not-whitelisted-in-the-appgw-3\/\">full chain cert<\/a><\/em>. Otherwise Application Gateway would complain cannot validate root certificate.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>The root certificate of the server certificate used by the backend does not match the trusted root certificate added to the application gateway. Ensure that you add the correct root certificate to whitelist the backend<\/code><\/pre>\n\n\n\n<p>To obtain full chain cert:<\/p>\n\n\n\n<p>On MacOS or Linux:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cat certificate.crt ca_bundle.crt &gt; full_chain.crt<\/code><\/pre>\n\n\n\n<p>On Windows:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>copy \/b certificate.crt + ca_bundle.crt full_chain.crt<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>Login to Aviatrix Controller, Settings -&gt; Security<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>If not using Application Gateway to front end controller:<br>CA Certificate : ca_bundle.crt<br>Server Public Certificate: certificate.crt<br>Server Private Key: private.key<br><\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1019\" height=\"677\" src=\"https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-7.png\" alt=\"\" class=\"wp-image-148\" srcset=\"https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-7.png 1019w, https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-7-300x199.png 300w, https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-7-768x510.png 768w\" sizes=\"auto, (max-width: 1019px) 100vw, 1019px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>If using Application Gateway to front end controller:<br>CA Certificate : ca_bundle.crt<br>Server Public Certificate: full_chain.crt<br>Server Private Key: private.key<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1023\" height=\"668\" src=\"https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-8.png\" alt=\"\" class=\"wp-image-149\" srcset=\"https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-8.png 1023w, https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-8-300x196.png 300w, https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-8-768x501.png 768w\" sizes=\"auto, (max-width: 1023px) 100vw, 1023px\" \/><\/figure>\n\n\n\n<ol class=\"wp-block-list\"><li>validate <strong>avx.mydomain.com<\/strong> would resolve to the Aviatrix controller&#8217;s public IP<\/li><li>Test access <strong>https:\/\/avx.mydomain.com<\/strong><\/li><\/ol>\n\n\n\n<p>If you want to revert back to self-signed certificate, goes back in the Aviatrix controller UI, Settings -&gt; Advanced -&gt; Security -&gt; Controller Imported Certificate Status -&gt; Imported Certificate Status -&gt; Toggle from <strong>Enabled <\/strong>to <strong>Disabled<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"626\" src=\"https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-9-1024x626.png\" alt=\"\" class=\"wp-image-157\" srcset=\"https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-9-1024x626.png 1024w, https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-9-300x183.png 300w, https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-9-768x470.png 768w, https:\/\/cloudlearning365.com\/wp-content\/uploads\/2022\/06\/image-9.png 1030w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>When first launched Aviatrix controller from marketplace, the Aviatrix controller give itself a self-signed certificate, and you have to use https:\/\/controller-ip to access it, which may not meet compliance requirement. This blog will talk about getting a public trusted SSL &hellip; <a href=\"https:\/\/cloudlearning365.com\/?p=139\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[2],"tags":[],"class_list":["post-139","post","type-post","status-publish","format-standard","hentry","category-aviatrix"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/cloudlearning365.com\/index.php?rest_route=\/wp\/v2\/posts\/139","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cloudlearning365.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudlearning365.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudlearning365.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudlearning365.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=139"}],"version-history":[{"count":8,"href":"https:\/\/cloudlearning365.com\/index.php?rest_route=\/wp\/v2\/posts\/139\/revisions"}],"predecessor-version":[{"id":889,"href":"https:\/\/cloudlearning365.com\/index.php?rest_route=\/wp\/v2\/posts\/139\/revisions\/889"}],"wp:attachment":[{"href":"https:\/\/cloudlearning365.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=139"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudlearning365.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=139"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudlearning365.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}