This blog post is about, how to setup a self-signed SSL certificate for an encrypted (https) communication with a Cloud Foundry application on IBM Cloud, if you are at a Hackathon. Keep in mind you don’t need to implement additional code inside of your Cloud Foundry application in this scenario. All is managed by IBM Cloud and you don’t need to modify your source-code. You need to have installed OpenSSL on your local machine and this example shows the setup on MacOS and Safari. You also need a Pay-As-You-Go or Trial-Account for the IBM Cloud to setup custom domain and ssl.
In my example situation I want to access my Node-RED instance with a custom domain and a self-signed SSL certificate.
Normally you would create a certificate signing request to get public key certificate to encrypt the communication with
https provided by a certificate authority for example “Let’s encrypt”, as you see simplified in the image below.
A certificate from a certificate authority can be costly, if you aren’t able to use a free certificate authority like for example “Let’s encrypt” supported by your domain provider. In my case the domain provider GoDaddy doesn’t support to request certificates directly from “Let’s encrypt”.
One easy solution to avoid additional costs is to create a self-signed certificate. This solution works well, if you only want to test and develop during a Hackathon and you have a very small count of users and you can give them the guidance to use the self-signed SSL certificate in their browser.
As you can see you need to upload self-signed SSL certificate in this simplified picture.
Overview of the needed steps
Here is an overview of the major needed steps:
- Create a custom domain and map it with the CNAME (this will result in the fully qualified domain name)
- Register the created custom domain in your Cloud Foundry org and region
- Create a route with your custom domain for your Cloud Foundry app
- Create a self-signed SSL certificate for custom domain
- Upload the self-signed certificate to IBM Cloud
- Invoke URL in a browser on a machine
- Copy the self-signed certificate from your browser to your computer
- Import the self-signed SSL certificate to the keychain of your operating-system on your local machine
- Restart the browser and see now your communication is encrypted