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
HTML


Edit the nginx config file:

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


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;
HTML

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
HTML

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
HTML

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
HTML

 

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

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


Then restart the server

sudo systemctl restart nginx

sudo systemctl restart factory.target
HTML

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
HTML


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;
HTML

Run this command from your install folder:

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


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
HTML

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
HTML

by

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

Then restart the server

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




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