Let’s Encrypt and certbot for HTTPS

Starting from version 1.9.2.340, Perfect Streamer supports automatic renewal of Let’s Encrypt certificates for HTTPS in Web Server, HTTP Server, EPG Server.

RHEL certbot configuration.

Restriction:

  • A white IP address with a public domain name must be assigned and the tcp/80 port must be free.

  • A single host name is used for all https servers. (web server, http server, epg server).

Installing certbot (https://certbot.eff.org/instructions?ws=other&os=snap):

sudo yum install snapd
sudo systemctl enable --now snapd.socket
sudo ln -s /var/lib/snapd/snap /snap
sudo snap install certbot --classic

certbot configuration:

sudo ln -s /snap/bin/certbot /usr/bin/certbot
sudo certbot certonly --standalone

certbot check:

sudo certbot renew --dry-run

certbot timer check:

systemctl list-timers | grep certbot

In the Perfect Streamer admin panel, enable HTTPS on servers (Web Server, HTTP Server, EPG Server).

Create a hook script (https://pstreamer.tv/distrib/scripts/cert_update.zip). Place it in the following path:

/opt/pss/scripts/cert_update.sh

Specify the host domain name in the script, by default it is taken from /etc/hostname.

Make the file executable.

chmod +x /opt/pss/scripts/cert_update.sh

Check the script run, there should be no errors:

/opt/pss/scripts/cert_update.sh

HTTPS settings should be applied, the status change will be displayed in the logs.

Add hook file to certbot:

certbot renew --deploy-hook "/opt/pss/scripts/cert_update.sh"

Check certbot again:

sudo certbot renew --dry-run

certbot configuration for Debian/Ubuntu.

Configuration for Debian is similar to RHEL, a brief installation description is given for Ubuntu 24.04.2 LTS.

Certbot installation:

apt install certbot
certbot certonly

Make the script executable:

chmod +x /opt/pss/scripts/cert_update.sh

Run the script:

/opt/pss/scripts/cert_update.sh

Outputs:

Select domain name (your domain name)

Check if the certificates have been updated:

ls -lat /opt/pss/config/cert/
total 44
-rw------- 1 root root  241 May 26 07:52 epgserver.key
-rw------- 1 root root  241 May 26 07:52 httpserver.key
-rw------- 1 root root  241 May 26 07:52 webserver.key
-rw-r--r-- 1 root root 1338 May 26 07:52 epgserver.crt
-rw-r--r-- 1 root root 1338 May 26 07:52 httpserver.crt
-rw-r--r-- 1 root root 1338 May 26 07:52 webserver.crt

The date should be current.