.. _ln_manager_webui_https_certificates: ************************* Web UI HTTPS Certificates ************************* The manager can serve the Web UI over HTTPS on its normal manager port when :ref:`webui_https_cert_file ` is configured. This is mainly useful when the browser is not running on the same host as the manager, because several browser features are restricted to secure contexts. For typical lab use, the browser URL will often contain a local host name, for example: .. code-block:: text https://rmc-lx0001:43809/ A browser checks 2 things: * the certificate must be trusted by the browser or operating system * the certificate must be valid for the exact name used in the URL If the browser opens ``https://rmc-lx0001:43809/``, the certificate must be valid for ``rmc-lx0001``. The TCP port is not part of the certificate name check, so the same certificate can be used on any manager port on that host. Local Lab Host Names ==================== For a host name such as ``rmc-lx0001`` or ``testbench-control``, a public certificate service normally cannot help directly. [#letsencrypt-public-dns]_ Those names are not public DNS names. They may resolve only inside the lab network, through local DNS, ``/etc/hosts``, VPN configuration, or site-specific name service. .. [#letsencrypt-public-dns] If the manager is reached through a real public DNS name that you control, a service such as Let's Encrypt can issue a browser-trusted certificate for that public name. This is not the usual setup for bare lab host names such as ``rmc-lx0001``. The usual lab solution is a local certificate authority: 1. Create or use a local lab certificate authority. 2. Make the browser machines trust that local certificate authority. 3. Issue a server certificate for each manager host name users will open, for example ``rmc-lx0001``. 4. Configure the manager to use the generated certificate and private key. .. code-block:: lnc instance # ... webui_https_cert_file: /path/to/rmc-lx0001.crt webui_https_key_file: /path/to/rmc-lx0001.key The certificate should contain the host name as a DNS subject alternative name, usually written as ``DNS:rmc-lx0001`` by certificate tools. Modern browsers rely on subject alternative names for this check. If users will open the Web UI through more than one name, include all of those names in the certificate. For example, a host might need both ``DNS:rmc-lx0001`` and ``DNS:rmc-lx0001.lab.example`` if both URLs are used. Creating A Lab CA On Ubuntu 24.04 ================================= Ubuntu 24.04 normally provides OpenSSL. If it is missing, install it first: .. code-block:: bash sudo apt install openssl Create a working directory on a trusted machine: .. code-block:: bash mkdir -p "$HOME/ln-manager-lab-ca" cd "$HOME/ln-manager-lab-ca" Create the lab certificate authority: .. code-block:: bash openssl genrsa -out lab-ca.key 4096 chmod 600 lab-ca.key cat > lab-ca.conf <<'EOF' [req] prompt = no distinguished_name = dn x509_extensions = v3_ca [dn] CN = LN Manager Lab CA [v3_ca] subjectKeyIdentifier = hash authorityKeyIdentifier = keyid:always,issuer basicConstraints = critical, CA:true keyUsage = critical, keyCertSign, cRLSign EOF openssl req -x509 -new -key lab-ca.key -sha256 -days 3650 \ -config lab-ca.conf -out lab-ca.crt Keep ``lab-ca.key`` private. It can issue certificates that browsers trusting ``lab-ca.crt`` will accept. Do not copy ``lab-ca.key`` to user laptops or to manager hosts that do not need to issue certificates. The file users import into Firefox is ``lab-ca.crt``. Creating A Host Certificate =========================== Create one certificate for the manager host name users will open in the browser. This example creates a certificate for ``rmc-lx0001`` and also allows ``rmc-lx0001.lab.example`` as a second name: .. code-block:: bash HOST=rmc-lx0001 openssl genrsa -out "$HOST.key" 2048 chmod 600 "$HOST.key" cat > "$HOST.conf" <