Skip to content

Certificates

Use SSL certificates to secure web access and connections to virtual desktops with viewers.

If you do not configure Let's Encrypt parameters, IsardVDI generates a default self-signed generic certificate during the initial installation. Browsers will prompt you to accept this certificate on first access to the IsardVDI web interface.

If you configure the Let's Encrypt domain parameters in isardvdi.cfg, IsardVDI generates a certificate for you and renews it automatically. Ensure that server ports 80 and 443 remain open for external access through this domain. If no certificate is present, IsardVDI generates a new self-signed certificate for default use.

You can also use your own certificate by replacing the auto-generated /opt/isard/certs/default/chain.pem with your concatenated certificate.

This configuration works for all flavors (portal, video, all-in-one) because they all use the same certificate configuration.

Certificate Types and Setup

IsardVDI supports three types of SSL certificates:

1. Self-Signed Certificates (Default)

  • Generated automatically when no other certificate is configured.
  • Best for: Testing, development, and private networks.
  • Location: /opt/isard/certs/default/chain.pem
  • Browser warning: Users will see security warnings and must manually accept the certificate.
  • Automatically generated and renewed when properly configured.
  • Best for: Production deployments with public domain access.
  • Requirements:
  • A public domain name pointing to your server.
  • Ports 80 and 443 accessible from the internet.
  • A valid email address for Let's Encrypt notifications.

Configuration in isardvdi.cfg:

DOMAIN=your-domain.com
ACME_EMAIL=admin@your-domain.com

# Optional: ACME CA to use (default is "letsencrypt"). See ACME_SERVER in isardvdi.cfg.example
#ACME_SERVER="letsencrypt"

# Optional: Separate domain for video hypervisor flavour
VIDEO_DOMAIN=video.your-domain.com

Renewal: Automatic daily renewal at 2:00 AM (Alpine Linux default schedule).

Important information: If you initially started with self-signed certificates and want to switch to Let's Encrypt, you must remove the existing certificates first:

docker-compose down
rm -rf /opt/isard/certs/default/*
# Update your isardvdi.cfg with DOMAIN and ACME_EMAIL
docker-compose up -d

3. Custom/Commercial Certificates

  • Manual installation of certificates from Certificate Authorities.
  • Best for: Enterprise environments with existing PKI infrastructure.
  • Supports: Commercial certificates, internal CA certificates, and wildcard certificates.

Spice certificates must be self-signed. They are autogenerated and distributed automatically to auto-registered hypervisors. They are kept in the /opt/isard/certs/viewers folder.

Manage certificates

Certificates are stored in the /opt/isard/certs/ directory. This directory always contains a self-signed or Let's Encrypt certificate named chain.pem.

If you are using self-signed or auto-generated Let's Encrypt certificates, no further action is required.

You can set your own certificate as described previously. Follow this guide to generate your custom xxxxx-chain.pem from your certificates.

Custom Certificate Installation

To install your own certificate, replace the auto-generated certificate:

# Stop IsardVDI
docker-compose down

# Remove existing certificates
rm -rf /opt/isard/certs/default/*

# Create your concatenated certificate as chain.pem
cat server-cert.pem server-key.pem > /opt/isard/certs/default/chain.pem

# Restart IsardVDI
docker-compose up -d

Commercial Certificate Example

For commercial certificates, include the intermediate chain:

# domain.crt:       domain certificate
# intermediate.pem: intermediate certificate
# domain.key:       private key

docker-compose down
rm -rf /opt/isard/certs/default/*
cat domain.crt intermediate.pem domain.key > /opt/isard/certs/default/chain.pem
docker-compose up -d

External Let's Encrypt Certificate

If you have a Let's Encrypt certificate obtained externally (not auto-generated by IsardVDI):

docker-compose down
rm -rf /opt/isard/certs/default/*
cat fullchain.pem privkey.pem > /opt/isard/certs/default/chain.pem
docker-compose up -d

Custom Certificate for All Flavours

All IsardVDI flavours (portal, video, all-in-one, hypervisor) use the same certificate configuration. There is no separate video certificate; all web traffic uses the same chain.pem file.

Examples with certificates from vendors

Commercial certificate

Place your concatenated certificate with the correct name in /opt/isard/certs/default/ (replace everything already in that folder).

Then, restart the portal (or video) container.

docker restart isard-portal

You can now connect to the IsardVDI server using the qualified CN provided with your certificate.

NOTE: Wildcard certificates have also been validated with this procedure to work as expected. See the example below:

Example wildcard SSL Certificate

For example, suppose you have a wildcard commercial certificate from a company (for instance, you bought *.isardvdi.com). You will receive the following files from your certificate provider:

  • wildcard_isardvdi_com.crt.pem: Your wildcard certificate.
  • GandiStandardSSLCA2.pem: The intermediate certificate from the certificate authority (in this example, the provider is gandi.net). You can always obtain this certificate by copying or exporting it from your browser's certificate settings or downloading it from their webpage (i.e. wget -q -O - https://www.gandi.net/static/CAs/GandiStandardSSLCA2.pem).
  • wildcard_isardvdi_com.key.pem: Your certificate private key.

You need to transform these files into the chain:

cat wildcard_isardvdi_com.crt.pem GandiStandardSSLCA2.pem wildcard_isardvdi_com.key.pem > /opt/isard/certs/default/chain.pem

Then, restart the portal (or video) container.

docker restart isard-portal

Reset certificates

If you replaced certificates and the system is not working, reset the certificates to restart the process. Manually manipulating files in the certificate folder can confuse the IsardVDI certificate processing code.

You can restore IsardVDI functionality with self-signed certificates by removing the /opt/isard/certs/default folder. IsardVDI will generate and configure a new self-signed certificate. The procedure is as follows:

docker-compose down
rm -rf /opt/isard/certs/default/*
docker-compose up -d

If you have a backup of your previously working self-signed certificates, you can copy them to the default certificate folder instead of generating new ones.

Troubleshoot certificates

Common issues and solutions

Certificate not loading or browser shows self-signed certificate

  1. Check that the certificate file exists and is valid:

    ls -la /opt/isard/certs/default/
    openssl x509 -in /opt/isard/certs/default/chain.pem -text -noout
    

  2. Restart the portal container:

    docker restart isard-portal
    

  3. Check the container logs:

    docker logs isard-portal
    

Let's Encrypt certificate generation failed

  1. Verify that the domain points to your server:

    nslookup your-domain.com
    

  2. Check that ports 80 and 443 are accessible:

    netstat -tulpn | grep :80
    netstat -tulpn | grep :443
    

  3. Check ACME logs and the working directory:

    docker exec isard-portal ls -la /etc/acme/
    docker exec isard-portal cat /var/log/acme-cron.log
    

Continuous HAProxy reloads (fixed in recent versions)

If you experience frequent HAProxy reloads, ensure you are using the latest version. Recent versions include: - Single cron daemon for certificate renewals (no dual crond processes) - No reload for certificate changes: changed certificates are hot-updated by cert-watch instead of reloading HAProxy

Certificate renewal issues

  • Renewal time: Automatic renewal attempts occur daily at 2:00 AM.
  • Force a renewal check:
    docker exec isard-portal acme.sh --cron --home /etc/acme
    

Emergency certificate reset

Reset to self-signed certificates

If certificates become corrupted or unusable:

# Stop IsardVDI
docker-compose down

# Remove only default certificates (BACKUP FIRST if needed)
sudo rm -rf /opt/isard/certs/default/*

# Restart - will generate new self-signed certificates
docker-compose up -d

Reset Let's Encrypt certificates

If Let's Encrypt certificates are expired or corrupted and you want to request fresh ones:

# Stop IsardVDI
docker-compose down

# Remove both default and acme certificates (BACKUP FIRST if needed)
sudo rm -rf /opt/isard/certs/default/*
sudo rm -rf /opt/isard/certs/acme/*

# Ensure DOMAIN and ACME_EMAIL are configured in isardvdi.cfg
# Restart - will request new ACME (Let's Encrypt) certificates
docker-compose up -d

Internal Certificate Flow

This section explains how certificates work internally in IsardVDI.

Certificate Processing Pipeline

  1. Container Startup (haproxy-docker-entrypoint.sh)
  2. Checks if /certs/chain.pem exists and is non-empty.
  3. If missing, triggers auto-generate-certs.sh to create a self-signed certificate.
  4. If present, uses the existing certificate.

  5. ACME Flow (acme-management.sh)

  6. Runs after HAProxy starts if ACME_EMAIL is set.
  7. The domain (ACME_DOMAIN) is taken from DOMAIN (or VIDEO_DOMAIN for the video flavour).
  8. The CA is ACME_SERVER (defaults to letsencrypt).
  9. LETSENCRYPT_EMAIL is accepted as a legacy alias for ACME_EMAIL.
  10. Registers the ACME account for ACME_EMAIL against ACME_SERVER.
  11. Issues the certificate via acme-generate-cert.sh (acme.sh --issue --stateless).
  12. Retries until HAProxy serves the certificate.

  13. Certificate Deployment (acme-generate-cert.sh)

  14. Deploys the certificate using acme.sh's HAProxy deploy-hook (acme.sh --deploy --deploy-hook haproxy).
  15. Writes the certificate to /certs/chain.pem.
  16. Hot-updates HAProxy through its stats socket (/var/run/haproxy.sock).

  17. Automatic Renewal (acme.sh cron)

  18. Scheduled daily at 2:00 AM (0 2 * * * acme.sh --cron --home /etc/acme).
  19. Logs are written to /var/log/acme-cron.log.
  20. Automatically re-deploys via the HAProxy deploy-hook on successful renewal.

  21. HAProxy Integration

  22. SSL Termination: HAProxy binds to port 8443 with ssl crt /certs/chain.pem.
  23. TCP Frontend: Port 443 routes traffic to the SSL terminator on port 8443.
  24. Certificate watch: a cert-watch process periodically checks the certificates HAProxy serves and hot-updates them through the HAProxy admin socket when they change on disk. It polls because inotify does not fire for a certificate renewed on the other side of an NFS mount. CERT_WATCH=off disables it.
  25. No restart needed: a changed certificate file is applied without restarting the container.

File Locations and Purposes

Path Purpose
/opt/isard/certs/default/chain.pem Primary certificate. Auto-generated (self-signed), Let's Encrypt, or custom.
/opt/isard/certs/acme/ acme.sh working directory (mounted as /etc/acme).
/opt/isard/certs/viewers/ Spice certificates for hypervisors.

Certificate Logic

IsardVDI certificate handling follows a simple logic:

  1. HAProxy always uses /opt/isard/certs/default/chain.pem.
  2. chain.pem contains:
  3. Let's Encrypt certificate (if ACME_EMAIL is configured and obtained successfully).
  4. Custom certificate (if you replaced the auto-generated one).
  5. Self-signed certificate (auto-generated as a fallback).

Please refer to the certificates troubleshooting section for additional troubleshooting.