Renew SSL Certificate
Introduction
An expired SSL certificate of the server affects the management of enrolled devices. Therefore, it is important to update the SSL certificate regularly to ensure smooth operation and control over the devices.
The certificate must be renewed. The procedure differs depending on the operating system and installation.
Docker
For a Docker installation, do the following:
- check the
docker-compose.ymlto see where the certificate orkeyis stored. Usually these files are namedserver.pemandserver.key. They are usually located in the same directory - look for the following section in the
docker-compose.yml
nginx:
volumes:
- "./server.pem:/etc/nginx/server.pem"
- "./server.key:/etc/nginx/server.key"
- in this example, the files are in the same directory as
docker-compose.yml - replace the
server.pemfile with the new certificate. Alternatively, you can open the file and replace the contents - restart the Docker container.
To do this, use the commands
docker compose downto stop the container first and thendocker compose up -dto start it again
Native installation Windows with nginx
For a Windows installation, do the following:
- if the
server.pemfile is not in the%ProgramFiles%\nginx\conf\directory, check thenginx.conffile to see where the certificate was placed. You can usually find this file in%ProgramFiles%\nginx\conf\nginx.conf - within this file, look for this section:
nginx.conf
ssl_certificate server.pem;
Replace the server.pem file with that of the new certificate, or open the file in an editor (run as administrator) and replace the contents with those of the new certificate.
Restart the nginx service afterwards.
Native installation CentOS Linux with nginx
For a native Linux installation, proceed as follows
- check if there is the expired certificate at
/etc/pki/tls/certs/server.pem - if it does, make a copy, open the file, remove the contents, and copy the contents of the new certificate into the
server.pemfile - alternatively, rename the existing file and place the new certificate under the name
server.pemin that path
sudo mv server.pem /etc/pki/tls/certs
sudo chown root:root /etc/pki/tls/certs/server.pem
sudo chmod 644 /etc/pki/tls/certs/server.pem
- after that the service
nginxhas to be restarted. To do this, typesystemctl stop nginxfollowed bysystemctl start nginx
Certbot
It may happen that Certbot has not requested a new certificate for various reasons.
You can do this manually.
To do this, type certbot --renew in the console to request a new certificate.