TLS Certificates

TLS Certificates

The control panel of Centova Cast uses HTTPS. HTTPS needs a TLS certificate for the hostname of the control panel. The installer gets this certificate for you during the installation. This page tells you what the installer needs for the certificate, and what to do if it cannot get one.

For complete TLS support documentation, see the Administration Manual.

Certificate Types at Installation

The installer can give the control panel one of two certificate types:

  • Let's Encrypt certificate
    The default. The installer gets a free certificate from letsencrypt.org for the hostname of the --hostname option. Web browsers and media players trust this certificate. Centova Cast renews the certificate automatically before it expires.

  • Self-signed certificate
    Used when you give the --no-letsencrypt option. Centova Cast generates the certificate itself, and renews it automatically. Web browsers and media players do not trust a self-signed certificate. They show an error message. Use a self-signed certificate only for tests, or if you will install a different certificate later.

The installer also makes the hostname of the control panel available for the streams, if no other streaming hostname exists. The streams then use the same certificate.

Requirements for a Let's Encrypt Certificate

Before you start the installer, make sure that:

  • The hostname is in DNS.
    The hostname of the --hostname option must point to the IP address of the server. If you give the --bind option, the hostname must point to that IP address. If you do not, it must point to the primary IP address of the server. If IPv6 is enabled on the server, the hostname must also point to the primary IPv6 address of the server.

  • Port 80 is free and reachable.
    Let's Encrypt connects to port 80 of the server to make sure that you control the hostname. During the installation, the installer starts a temporary web server on port 80 for this check. No other web server can use port 80 at this time. Your firewall must let connections from the Internet reach port 80.

  • Port 80 is in the installation.
    The control panel must use port 80 for HTTP. You cannot get a Let's Encrypt certificate if you install with --no-webports, or with --ports and an HTTP port other than 80. The installer refuses these combinations unless you also give --no-letsencrypt.

Note that DNS changes can take up to 24 hours to reach all DNS servers. If you changed the DNS record of the hostname recently, wait until the change is visible before you start the installer.

Installer Options for the Certificate

  • --hostname=HOSTNAME
    Specifies the hostname of the control panel. The certificate is issued for this hostname.

  • --email=EMAIL
    Specifies the email address of the administrator. The installer also uses this address for the registration with letsencrypt.org, unless you give --le-email.

  • --le-email=EMAIL
    Specifies a different email address for the registration with letsencrypt.org.

  • --le-staging
    Gets the certificate from the staging servers of letsencrypt.org. A staging certificate is not trusted. Use this option only to test the installation, for example to avoid the rate limits of letsencrypt.org. Later ACME certificates also come from the staging servers.

  • --no-letsencrypt
    Prevents the request to letsencrypt.org. Centova Cast uses a self-signed certificate.

What the Installer Does

After it configures Centova Cast, the installer does these steps for a Let's Encrypt certificate:

  1. It starts the temporary web server on port 80.
  2. It shows Testing DNS configuration and makes sure that the hostname points to the IP address of the server.
  3. It shows Obtaining TLS certificate ... and requests the certificate from letsencrypt.org.
  4. It shows Installing TLS certificate, then stops the temporary web server.

For a self-signed certificate, the installer does not test DNS and does not use port 80.

If the Installer Cannot Get a Certificate

If the DNS test fails, the installer shows a message like this, and stops:

DNS check failed. Ensure that the hostname cast.example.com is correctly configured in DNS to point to the IP address 203.0.113.10.

If the request to letsencrypt.org fails, the installer shows the error from letsencrypt.org, and stops.

In both cases, the installer removes the incomplete database and configuration file. Do one of these:

  • Correct the problem and run the installer again with the same options. For example, correct the DNS record, stop the other web server on port 80, or open port 80 in the firewall.
  • Run the installer again with the --no-letsencrypt option. Centova Cast then uses a self-signed certificate. When the problem is corrected, open /usr/local/centovacast/etc/castd.conf in a text editor. In the web-service block, change tls-method self to tls-method acme. Then restart Centova Cast with systemctl restart cc-castd.

Note that the tls-method key sets the certificate type of the control panel each time Centova Cast starts. If you change the certificate type of the control panel only on the Hostnames page, Centova Cast sets the type back to the value of tls-method at the next start.

Wildcard Hostnames

A wildcard hostname (for example *.example.com) gives each client account a hostname of its own. Let's Encrypt issues a certificate for a wildcard hostname only after a DNS validation through your DNS provider. Centova Cast uses the lego package for this validation. If you will use wildcard hostnames with Let's Encrypt, install this package:

/usr/local/centovacast/sbin/install lego

The configuration of the DNS provider is not part of the installation. For the procedure that configures the DNS provider, and for complete TLS support documentation, see the Administration Manual.