This article is for running a force.com site to get data in or out of your salesforce database.
You might already be using a force.com site with a custom domain, but browsers are now preferring SSL (https) and users might even be warned if they visit your force.com site if it doesn’t use SSL.
Create an SSL Certificate:
Download the Certificate Signing Request (CSR)
This will download a text file to your computer. Make sure you can open it in notepad (or a text editor of your choice) because later you will need to copy and paste the content.
Create an SSL Certificate with ZeroSSL
Sign up for a free account at ZeroSSL.com which includes 3 free SSL certificates. Once you reach the dashboard, click “New Certificate”:
At the step “CSR & Contact” you should “paste existing csr” instead of creating a new one:
After you’ve finalized your order and confirmed you own the domain name, you will be able to download the certificate file (zip):
Combine Certificate Chain
The zip file you downloaded from ZeroSSL contains two files: certificate.crt and ca_bundle.crt. These are both text files and you need to copy and paste them together like this ( certificate.crt on top, ca_bundle.crt on bottom).
Here I’m using Sublime Text, but you can use Notepad.exe, VSCode, or any editor you like:
Upload Certificate to Salesforce
The combined certificate can now be uploaded to your certificate record in salesforce (where we generated the CRT earlier):
The upload form will reject your certificate file if you copy and paste the values in the wrong order, so you will know immediately if you did it right.
Update your domain from your force.com site
If you are already using a custom domain, then your DNS should already be correct, but double check in case it’s an old domain.
Wait for Provisioning Status
This step can be as fast as 30 mins, but can also take hours…
Wait for the “Activate” button to be clickable, then click it to deploy the certificate. The “Provisioning Status” will change from “Awaiting Custom URL” to “Provisioning”.
Update your force.com site to prefer https
At this point, your domain will start to show with HTTPS and you’ll get that nice little pad lock on the address bar!