Skip to content

[Bug]: Agent docker image v0.19.0 missing root CA certificates (fails TLS verification on valid certs) #2291

Closed

Description

@sunatley

Welcome!

  • I have read the Documentation
  • I have checked the Common Issues Guide and my problem was not mentioned there.
  • I have searched open and closed issues and my problem was not mentioned before.
  • I have verified I am using the latest version available. You can check the latest release here.

Component

Agent

Problem Description

In v0.19.0, agents now enforce HTTPS certificate verification. However, the official docker image henrygd/beszel-agent:0.19.0 (and latest) is built FROM scratch in internal/dockerfile_agent without copying system root certificates (ca-certificates.crt).

As a result, the agent container has no trust store at all. Even when the Hub is behind a reverse proxy using a valid public certificate (such as Let's Encrypt ISRG Root X1), the Go runtime fails with:
WARN WebSocket connection failed err="tls: failed to verify certificate: x509: certificate signed by unknown authority"

In internal/dockerfile_hub, certificates are properly installed and copied to the scratch image:

RUN apk add --no-cache ca-certificates && update-ca-certificates
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/

However, internal/dockerfile_agent is missing this step.

Expected Behavior

The agent container should include standard root CA certificates so it can connect out-of-the-box to Hubs configured with valid public HTTPS certificates (Let's Encrypt, Cloudflare, DigiCert, etc.) without requiring manual volume mounts of host CA files or custom CA_CERT_FILE configuration.

Steps to Reproduce

  1. Set up Beszel Hub behind a reverse proxy using a valid Let's Encrypt SSL certificate.
  2. Run the agent using the official Docker image henrygd/beszel-agent:0.19.0 with HUB_URL="https://your-hub-domain.com".
  3. Check the agent container logs: docker logs beszel-agent.
  4. Observe the error:
    WARN WebSocket connection failed err="tls: failed to verify certificate: x509: certificate signed by unknown authority"
  5. Workaround: Mount the host CA bundle (-v /etc/ssl/certs/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt:ro) into the container, recreate the container, and observe that it connects successfully immediately.

OS / Architecture

linux/amd64 (Debian host)

Beszel version

0.19.0

Installation method

Docker

Configuration

services:
  beszel-agent:
    image: henrygd/beszel-agent:0.19.0
    container_name: beszel-agent
    restart: unless-stopped
    network_mode: host
    volumes:
      - ./beszel_agent_data:/var/lib/beszel-agent
      - /var/run/docker.sock:/var/run/docker.sock:ro
    environment:
      PORT: 45876
      KEY: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5..."
      HUB_URL: "https://your-hub-domain.com"
      TOKEN: "your_token"

Hub Logs

N/A (Hub is healthy, issue is purely on the agent TLS trust store)

Agent Logs

WARN WebSocket connection failed err="tls: failed to verify certificate: x509: certificate signed by unknown authority"

Activity

  1. added
    bug
    on Sep 3, 2026
  2. butaford commented on Sep 3, 2026

    @butaford

    volumes:

    • /etc/ssl:/etc/ssl/:ro
  3. zyberspace commented on Sep 3, 2026

    @zyberspace

    The :alpine variant works btw. I just switched my Agents to that. In case anyone needs a quick fix, other than reverting to the previous version.

  4. henrygd commented on Sep 3, 2026

    @henrygd
    Owner

    Sorry about that, I'll patch it and update the image. :alpine does work, and is what the :dev agent is based on, so I didn't catch this.

  5. henrygd commented on Sep 3, 2026

    @henrygd
    Owner

    It should be fixed now if you pull a new image and recreate the container.

    docker compose pull && docker compose up -d
  6. pinned this issue on Sep 3, 2026
  7. cybertaurus commented on Sep 3, 2026

    @cybertaurus

    Seems to be fixed after pulling. Had the same issue here. Thanxs for quick fixing it!

  8. zyberspace commented on Sep 3, 2026

    @zyberspace

    Can also confirm the new image fixes the issue. 👍

  9. mdguggenbichler commented on Sep 4, 2026

    @mdguggenbichler

    Can confirm I was able to upgrade to 0.19.0 this time without changing anything regarding certs (no CA_CERT_FILE workaround needed). Previously hit the exact x509: certificate signed by unknown authority error described above; pulling the image fresh today resolved it.

  10. unpinned this issue on Sep 19, 2026
  11. locked and limited conversation to collaborators on Oct 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions