Switching a http server to https

Modified on Tue, 14 Feb, 2023 at 5:51 PM

Automate-IT and Pulse-IT can be configured either in http or in https. In order to switch an already installed server from http to https, here are the necessary steps.


With a CentOS/RedHat setup

On the server side

Run this command from your install folder:

sudo ./setup.py --migrate-to-ssl


Edit the nginx config file:

nano /etc/nginx/sites-available/embrace-app-https.conf


and replace the path for ssl_certificate et ssl_certificate_key with your cerficates filepaths. 

ssl_certificate /etc/ssl/factory-cert.pem;
ssl_certificate_key /etc/ssl/factory-key.pem;

Important note:

Do not replace the existing files (factory-cert.pem and factory-key.pem), use another name or another location instead.


Then restart the nginx server


sudo systemctl restart nginx

sudo systemctl restart factory.target

On the agent side:

Edit the agent.ini file and set the new SERVER_ADDRESS (I.E https;//… instead of http;//)

set the new server address (I.E https;//… instead of http;//
SERVER_ADDRESS = https://pulse-it.embrace.dev

Restart agent using the shortcut available on your desktop.


Scheduler settings

Go to the scheduler menu and check that the event server is using the the right protocol (http or https depending on your installation.


Switching back to HTTP

You may have to switch back to http. To achieve that goal, edit the factory.ini file and set the SSL_ENABLED flag to False.


Remove the embrace-app-https.conf symbolic link in the /etc/nginx/sites-enabled/ directory

rm /etc/nginx/sites-enabled/embrace-app-https.conf

 

Create a new one embrace-app.conf in /etc/nginx/sites-enabled/

ln -s /etc/nginx/sites-available/embrace-app.conf embrace-app.conf


Then restart the server

sudo systemctl restart nginx

sudo systemctl restart factory.target

With a Docker Compose setup

On the server side

Copy SSL certificate to conf/certs directory.


Do not replace the existing files (factory-cert.pem and factory-key.pem), use another name or another location instead


Edit the nginx config file:

nano conf/nginx/nginx-ssl.conf


and replace the path for ssl_certificate et ssl_certificate_key with your certificates filepaths

ssl_certificate /etc/ssl/factory-cert.pem;
ssl_certificate_key /etc/ssl/factory-key.pem;

Run this command from your install folder:

./embrace-app.sh --migrate-to-ssl


On the agent side:

Edit the agent.ini file and set the new SERVER_ADDRESS (I.E https;//… instead of http;//)

set the new server address (I.E https;//… instead of http;//
SERVER_ADDRESS = https://pulse-it.embrace.dev

Restart agent using the shortcut available on your desktop


Scheduler settings

Go to the scheduler menu and check that the event server is using the the right protocol (http or https depending on your installation.

Switching back to HTTP

You may have to switch back to http. To achieve that goal, edit the factory.ini file and set the SSL_ENABLED flag to False.


Edit the docker-compose.yml file and replace this line

   - ./conf/nginx/nginx-ssl.conf:/etc/nginx/nginx.conf

by

   - ./conf/nginx/nginx.conf:/etc/nginx/nginx.conf

Then restart the server

./embrace-app.sh --down
./embrace-app.sh




Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article