Installing LetsEncrypt SSL Certificate on Polarity Server
The following document walks through installing a LetsEncrypt SSL Certificate on the Polarity Server. Let's Encrypt is a free, automated, and open certificate authority. To be able to use a LetsEncrypt certificate, the Polarity Server must have:
A non-IP fully qualified domain name that is Internet routable (i.e., you must be able to reach your Polarity server from the open Internet and the FQDN cannot be an IP address)
Port 80 must be open when you are requesting the certificate from LetsEncrypt so they can validate ownership of the server.
LetsEncrypt is not a good solution for an SSL certificate if you need to IP whitelist your Polarity Server (e.g., block access using an AWS security group) or if your Polarity Server is on an internal network.
Ensure you have the RHEL/CentOS7 EPEL repo installed
Install CertBot
Get a LetsEncrypt certificate
To be able to get a certificate you must have port 80 open. Be default, the Polarity Server will listen on port 80 and redirects traffic to port 443
You will be prompted for the FQDN of your Polarity server.
The certificate will be downloaded to /etc/letsencrypt/live/{{FQDN}}/fullchain.pem
and the private key will be downloaded to /etc/letsencrypt/live/{{FQDN}}/privkey.pem
Change the permissions on the downloaded certificates so that the polarityd
user is able to read them:
Once the certificates are downloaded, update the Polarity nginx configuration to use the LetsEncrypt certificates instead of the default self-signed certificates. Open the nginx config file with a text editor:
Next, update ssl_certificate
and ssl_certificate_key
properties with the new certificate paths:
Replace {{FQDN}}
with the correct fully qualified domain name of your Polarity server
After saving the change to the nginx configuration, restart nginx:
Check to make sure nginx came back up successfully:
After updating the nginx config, you will need to update the Polarity Server configuration to use the new certificates. Open the config file located at /app/polarity-server/config/config.js
in a text editor.
Find the settings rest.credentials.key
and rest.credentials.certificate
and update them with the correct key and certificate paths from LetsEncrypt:
Save the file and then restart the Polarity Server
Check to make sure all Polarity services are running:
Finally, setup automatic cert renewal of the certificate
Last updated