How to generate the crt and key of a certificate on base64 for a custom domain on Liferay PaaS?

Note: please note that Liferay has renamed its Liferay Experience Could offerings to Liferay SaaS (formerly LXC) and Liferay PaaS (formerly LXC-SM).

Issue

  • As stated on this documentation you'll need to add both the crt and the key on base 64 on the LCP.json file.
{
  "id": "webserver",
  "loadBalancer": {
    "cdn": true,
    "targetPort": 80,
    "customDomains": ["acme.liferay.cloud"],
    "ssl": {
      "key": "...",
      "crt": "..."
    }
  }
}
  • With that in mind, what is the recommended procedure to add a base64 certificate and key for a custom domain on Liferay PaaS?

Environment

  • Liferay PaaS

Resolution

  • Unix systems come with the base64 command. You'll need the .crt and the .key file. You can call the command to act on the files with the cat command and the pipeline.
cat [file_name].crt | base64 -w 0
cat [file_name].key | base64 -w 0
  •  The argument -w 0 is to disable line wrapping. Some Unix systems (like MacOS) already have this by default, so you may need to execute only the base64 with no arguments.

Additional Information

  

Was this article helpful?
0 out of 1 found this helpful