How to add Custom SSL Certificate
If a custom SSL certificate for HTTPS traffic (IP Fabric main GUI) is required, follow this guide to change the certificate manually:
-
Make a backup of your previous server certificate and key:
mv /etc/nginx/ssl/server.crt /etc/nginx/ssl/server.crt.bkp mv /etc/nginx/ssl/server.key /etc/nginx/ssl/server.key.bkp
-
Upload new certificate chain and private key to the
/etc/nginx/ssl/
folder- It has to have the same name
server.crt
andserver.key
server.crt
file needs to contain a new SSL certificate and full certificate chain in PEM formatserver.key
file needs to contain server certificate’s private key in decrypted PEM format
- It has to have the same name
-
The certificate chain in
server.crt
must have the following sequence:- Server Certificate
- Intermediate Certificate(s)
- Root Certificate
-
Make sure that files have correct owner and group
root:autoboss
- Make sure your current working directory is
/etc/nginx/ssl
you can usepwd
command to be sure, if you’re somewhere else then use this command:cd /etc/nginx/ssl
- You can check the owner of the files with
ls -l
command - If current owner and group are
root:root
then execute following command:chown root:autoboss server.crt server.key
- Check if the
MD5
hashes for theserver.crt
andserver.key
files are the same:
Example
root@ipfabric:/etc/nginx/ssl# openssl x509 -noout -modulus -in server.crt | openssl md5 (stdin)= 9dcfd46578b9dffe06ca0146607f6153 root@ipfabric:/etc/nginx/ssl# openssl rsa -noout -modulus -in server.key | openssl md5 (stdin)= 9dcfd46578b9dffe06ca0146607f6153
Danger
Do not proceed with the next steps if the
MD5
hashes don’t match! - Make sure your current working directory is
-
Restart
nginx
with the following command:systemctl restart nginx
-
Check if
nginx
runs correctly with:systemctl status nginx