<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>OPENSSL on DecipherMiddleware</title><link>https://blog.deciphermiddleware.in/tags/openssl/</link><description>Recent content in OPENSSL on DecipherMiddleware</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Fri, 08 Sep 2023 14:58:00 +0000</lastBuildDate><atom:link href="https://blog.deciphermiddleware.in/tags/openssl/index.xml" rel="self" type="application/rss+xml"/><item><title>Configure Custom Domain in Private Space : CloudHub 2.0</title><link>https://blog.deciphermiddleware.in/posts/configure-custom-domain-in-private/</link><pubDate>Fri, 08 Sep 2023 14:58:00 +0000</pubDate><guid>https://blog.deciphermiddleware.in/posts/configure-custom-domain-in-private/</guid><description>&lt;p&gt;With CloudHub 2.0, applications are deployed in public spaces or private spaces. Private space isolates the applications deployed, and different network customizations can be done within the private space. Earlier in CloudHub 1.0, DLB used to be configured to balance the incoming load along with configuring the custom/vanity domain instead of using *&lt;strong&gt;.cloudhub.io&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.deciphermiddleware.in/images/blogger/def6c4a89c.gif"&gt;&lt;img src="https://blog.deciphermiddleware.in/images/blogger/def6c4a89c.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;We can configure vanity/custom domains in the private space, avoiding accessing the applications through the default *&lt;strong&gt;.cloudhub.io&lt;/strong&gt; domain. Configuring the custom domain will require the public certificate and the private key as a prerequisite.&lt;/p&gt;
&lt;h2 id="generating-the-self-signed-public-certificate-and-the-private-key"&gt;Generating the self-signed public certificate and the private key &lt;a href="#generating-the-self-signed-public-certificate-and-the-private-key" class="anchor"&gt;🔗&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;For simplicity, we will try to create certificates for the wildcard domain. To generate the self-signed public certificate and private key, we will require &lt;strong&gt;OpenSSL&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;1. Create a config file as below, name it &lt;strong&gt;config.cfg&lt;/strong&gt; , and change the values as per the domain details.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;[&lt;/span&gt; req &lt;span class="o"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;default_bits&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;2048&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;distinguished_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; req_distinguished_name
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;prompt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; no
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;[&lt;/span&gt; req_distinguished_name &lt;span class="o"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;countryName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; IN
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;stateOrProvinceName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; Punjab
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;localityName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; Amritsar
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;organizationName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; DecipherMiddleware
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;commonName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; *.domain.com
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;2. Run the below command through the terminal. Currently, expiration is set to 3000 days.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;openssl req -newkey rsa:2048 -nodes -keyout deciphermiddleware-in-private.pem -x509 -days &lt;span class="m"&gt;3000&lt;/span&gt; -out deciphermiddleware-in-crt.pem -config config.cfg
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="https://blog.deciphermiddleware.in/images/blogger/92186dffc9.png"&gt;&lt;img src="https://blog.deciphermiddleware.in/images/blogger/92186dffc9.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This will generate 2 files: a public certificate and a private key. These 2 files will be used in the later stage.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.deciphermiddleware.in/images/blogger/e276dc0268.gif"&gt;&lt;img src="https://blog.deciphermiddleware.in/images/blogger/e276dc0268.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="steps-anypoint-platform"&gt;Steps: Anypoint Platform &lt;a href="#steps-anypoint-platform" class="anchor"&gt;🔗&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;Let&amp;rsquo;s now log in to the Anypoint Platform.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.deciphermiddleware.in/images/blogger/ad32eeabb7.gif"&gt;&lt;img src="https://blog.deciphermiddleware.in/images/blogger/ad32eeabb7.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;1. Go to Runtime Manager and click private spaces.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.deciphermiddleware.in/images/blogger/cf803f58f2.png"&gt;&lt;img src="https://blog.deciphermiddleware.in/images/blogger/cf803f58f2.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;2. Select the private space, where the custom/vanity domain needs to be configured. Click on &lt;strong&gt;Domains &amp;amp; TLS&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.deciphermiddleware.in/images/blogger/e2564ed02c.png"&gt;&lt;img src="https://blog.deciphermiddleware.in/images/blogger/e2564ed02c.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;3. Click on Create TLS Context.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.deciphermiddleware.in/images/blogger/4d16960a2f.png"&gt;&lt;img src="https://blog.deciphermiddleware.in/images/blogger/4d16960a2f.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;4. Enter the name for configuration. Upload the public certificate and the private key created in the previous steps. Certificates have been configured to have domains as *&lt;strong&gt;.mule.deciphermiddleware.in&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.deciphermiddleware.in/images/blogger/ec9bbbb28f.png"&gt;&lt;img src="https://blog.deciphermiddleware.in/images/blogger/ec9bbbb28f.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;5. Enter the keystore password, if the keystore was encrypted. If you have CA signed certificate upload that as well.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.deciphermiddleware.in/images/blogger/6442fe7a40.png"&gt;&lt;img src="https://blog.deciphermiddleware.in/images/blogger/6442fe7a40.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;6. Click on &lt;strong&gt;Create TLS Context&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.deciphermiddleware.in/images/blogger/14d53e4b38.png"&gt;&lt;img src="https://blog.deciphermiddleware.in/images/blogger/14d53e4b38.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;7. A new TLS context will be created as below.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.deciphermiddleware.in/images/blogger/5e8efb60bd.png"&gt;&lt;img src="https://blog.deciphermiddleware.in/images/blogger/5e8efb60bd.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s configure an application to use the newly configured custom domain.&lt;/p&gt;
&lt;p&gt;8. Open any CloudHub 2.0 application deployed in the Private Space. Go to settings. Click on &lt;strong&gt;Ingress&lt;/strong&gt; , and click on &lt;strong&gt;Add Endpoint&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.deciphermiddleware.in/images/blogger/c298258d5e.png"&gt;&lt;img src="https://blog.deciphermiddleware.in/images/blogger/c298258d5e.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;9. Change the host to the custom host configured. For now, leave the remaining fields as is. Click on Apply Changes. This will deploy the application with a new configuration as defined by the deployment model.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.deciphermiddleware.in/images/blogger/746ebb6e35.png"&gt;&lt;img src="https://blog.deciphermiddleware.in/images/blogger/746ebb6e35.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;10. Before using the custom domain, make sure the DNS record with the following values is being configured.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Record Type&lt;/th&gt;
&lt;th&gt;CNAME&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Host (or Name)&lt;/td&gt;
&lt;td&gt;wildcard or wildcard with subdomain (*.mule used in the current example)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Value (or Content)&lt;/td&gt;
&lt;td&gt;Private Space default hostname&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id="validate-if-the-dns-record-is-working"&gt;Validate if the DNS record is working &lt;a href="#validate-if-the-dns-record-is-working" class="anchor"&gt;🔗&lt;/a&gt;&lt;/h2&gt;&lt;p&gt;The below command can be used to check if the DNS records are configured properly.&lt;/p&gt;
&lt;p&gt;nslookup &lt;host-of-application&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.deciphermiddleware.in/images/blogger/a5e6eb28a9.png"&gt;&lt;img src="https://blog.deciphermiddleware.in/images/blogger/a5e6eb28a9.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If private space static IPs and default hostname are visible as output, then configuration is proper and DNS routing is working as expected.&lt;/p&gt;
&lt;p&gt;Apps can be accessed using the custom/vanity domains.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.deciphermiddleware.in/images/blogger/bad297b70d.gif"&gt;&lt;img src="https://blog.deciphermiddleware.in/images/blogger/bad297b70d.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3 id="references"&gt;References &lt;a href="#references" class="anchor"&gt;🔗&lt;/a&gt;&lt;/h3&gt;&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://docs.mulesoft.com/cloudhub-2/ps-config-domains#before-you-begin"&gt;https://docs.mulesoft.com/cloudhub-2/ps-config-domains#before-you-begin&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Please share your valuable feedback 😊😊😊&lt;/p&gt;</description></item></channel></rss>