Certificates

MeshCentral Let's Encrypt – Trusted HTTPS Certificates Made Simple

How to remove browser warnings with a trusted certificate while keeping every agent connected.

Diagram of MeshCentral registering with Let's Encrypt and receiving an HTTPS certificate

MeshCentral generates a self-signed certificate the first time it runs, which is enough to encrypt traffic but not enough to earn a browser's trust. Every visit then begins with a warning page, and users learn to click past security warnings, which is precisely the habit an attacker hopes for. Replacing the self-signed certificate with a trusted one from Let's Encrypt removes the warnings, makes the dashboard look professional and protects users from interception. This article explains how certificates work in MeshCentral, how its built-in Let's Encrypt support operates, how to configure it safely and how to avoid the mistakes that leave agents unable to connect.

Two Certificates, Two Jobs

MeshCentral uses certificates in two distinct ways, and understanding the difference prevents most certificate problems.

  • The web certificate is what browsers see. It must be issued for the exact hostname users type and signed by an authority the browser trusts.
  • The agent certificate belongs to the server's identity. Agents remember its fingerprint when they are installed and use it to confirm, on every connection, that they are talking to the right server.

When you install a Let's Encrypt certificate, you replace the web certificate. The agent identity stays the same, which is why agents installed before the change continue to connect afterwards. The important exception is a reverse proxy that terminates TLS, which is discussed later.

What Let's Encrypt Requires

Let's Encrypt issues certificates at no cost, automatically, to anyone who can prove control of a domain name. For a MeshCentral server, that means:

  • A real domain name. Certificates are not issued for bare IP addresses or for internal names that do not exist in public DNS.
  • Public DNS pointing to the server. The hostname must resolve to the address where MeshCentral, or its proxy, is reachable.
  • Port 80 reachable from the internet. MeshCentral proves control of the domain using the HTTP challenge, in which Let's Encrypt fetches a token over plain HTTP on port 80.
  • A contact email address. Let's Encrypt uses it for important notices about the account or certificates.

If your server lives entirely on a private network with no public access, Let's Encrypt's HTTP challenge cannot reach it. In that case, use a certificate from your internal certificate authority or a DNS-based method through a reverse proxy.

Configuring the Built-in Support

MeshCentral includes an ACME client, so no separate tool is required. Add a letsencrypt section to config.json alongside the existing settings:

{
  "settings": {
    "cert": "mesh.yourdomain.example",
    "port": 443,
    "redirPort": 80
  },
  "letsencrypt": {
    "email": "admin@yourdomain.example",
    "names": "mesh.yourdomain.example",
    "production": false
  }
}

The cert value and the names value should match the hostname users will type. The redirPort must be 80 so that MeshCentral can answer the HTTP challenge on that port.

Starting with the Staging Environment

Notice that production is set to false in the example. Let's Encrypt offers a staging environment for testing, which issues certificates that browsers do not trust but which follow exactly the same process. Production issuance is subject to rate limits, so repeated failed attempts against production while you fix a DNS or firewall problem can temporarily block further requests for your domain.

The sensible sequence is:

  • configure Let's Encrypt with production set to false;
  • restart MeshCentral and watch its output for a successful staging certificate;
  • open the dashboard and confirm that a staging certificate is being served;
  • change production to true and restart again to obtain the trusted certificate.

Always prove the process works against staging before requesting a production certificate.

Watching the Process Work

When MeshCentral starts with Let's Encrypt configured, it registers with the service, requests a certificate for the listed names, answers the challenge on port 80 and stores the resulting certificate in its data folder. It then serves the new certificate to browsers. Messages in the server output or service log report each stage, including any errors returned by Let's Encrypt.

Renewal is automatic. Let's Encrypt certificates have short lifetimes, and MeshCentral renews them well before they expire, as long as port 80 remains reachable and DNS continues to point at the server.

Multiple Names and Domains

A single certificate can cover several hostnames by listing them, separated by commas, in the names value. This is useful when one server hosts several MeshCentral domains, each reached by its own hostname. Every listed name must resolve to the server and pass the challenge, so add names only once their DNS records are in place.

Using a Reverse Proxy Instead

Many administrators let a reverse proxy such as Caddy, Traefik, NGINX with Certbot or HAProxy obtain the certificate. In that arrangement, the built-in Let's Encrypt section is not used. Instead, MeshCentral is configured for TLS offloading and must learn the certificate that the proxy presents, usually through the certUrl setting. If that step is missed, browsers will work while agents fail to connect, because they cannot verify the certificate they now see. Choose one approach, either MeshCentral obtaining certificates or the proxy doing so, and configure it fully.

Bringing Your Own Certificate

Organisations with their own certificate authority or a commercial certificate can supply it directly. Place the certificate and private key in the data folder using the file names MeshCentral expects for its web certificate, then restart the server. Remember that you, not MeshCentral, are then responsible for renewing the certificate before it expires.

Protecting Certificates and Keys

Private keys in the data folder must be guarded carefully. Anyone holding them could impersonate your server to browsers, and the agent keys could be used to impersonate it to agents. Restrict file permissions so that only the MeshCentral service account can read the folder, encrypt backups that contain it and never share configuration archives without removing keys first.

Troubleshooting Certificate Problems

The challenge fails

Port 80 is not reachable from the internet, another program is using it or a firewall is blocking it. Check that DNS resolves to the right address and that the server answers on port 80 from outside your network.

Rate limit errors

Too many production requests have failed or been made in a short period. Switch back to staging, fix the underlying problem and wait for the limit to reset before trying production again.

Browsers still show the old certificate

The server may not have restarted after the configuration change, or a proxy may be serving its own certificate. Restart MeshCentral and check which component presents the certificate.

Agents went offline after the change

This usually indicates that a proxy is terminating TLS without MeshCentral being told about it. Configure tlsOffload and certUrl, or let MeshCentral handle TLS itself.

The certificate expired

Automatic renewal stopped, typically because port 80 was closed or DNS changed. Restore access to port 80, restart the server and add monitoring for certificate expiry so that it never surprises you again.

How the HTTP Challenge Works

Understanding the challenge makes troubleshooting much easier. When MeshCentral requests a certificate, Let's Encrypt replies with a unique token and asks the server to publish it at a specific address on the domain, served over plain HTTP on port 80. MeshCentral places the token there automatically. Let's Encrypt's servers then connect to the domain from the internet, fetch the token and compare it with what they issued. If it matches, they know the requester controls the domain and issue the certificate.

This explains every common failure. If DNS points elsewhere, Let's Encrypt fetches the token from the wrong machine. If port 80 is blocked by a firewall or router, the fetch fails. If another program is answering on port 80, it cannot return the token. Checking each of these points in turn resolves almost every challenge error.

Certificates for Servers on Private Networks

Not every MeshCentral server is reachable from the internet, and that is perfectly reasonable for internal deployments. For these servers, there are still good alternatives to the self-signed default.

  • An organisation's own certificate authority can issue a certificate that domain-joined computers already trust.
  • A reverse proxy that supports the DNS challenge can obtain a Let's Encrypt certificate by creating a temporary DNS record, without the server being reachable at all.
  • A commercial certificate can be installed manually, with renewal tracked in your own calendar.

Whichever you choose, the principle is the same: users should never be trained to accept certificate warnings.

Monitoring Certificate Expiry

Automatic renewal is reliable, but it depends on conditions that can change quietly, such as a firewall rule or a DNS record. An independent expiry check costs almost nothing and gives early warning. Many uptime monitoring services check certificate validity alongside availability, and a simple scheduled script can do the same. Aim to be alerted at least two weeks before expiry, leaving ample time to investigate.

Changing the Hostname Later

If the server's hostname must change, plan the move carefully. Add the new name to DNS, include both old and new names in the certificate during the transition and update the cert setting. Agents locate the server by the address stored when they were installed, so devices may need a new agent from the updated group before the old name is retired. Changing names is entirely possible, but it is far easier to choose a permanent hostname at the start.

Frequently Asked Questions

Yes. It has a built-in ACME client configured through the letsencrypt section of config.json.

MeshCentral proves domain control using the HTTP challenge, which Let's Encrypt performs over plain HTTP on port 80.

No. You need a domain name with public DNS pointing to the server.

Not when MeshCentral serves the certificate itself, because agent trust is based on the server's identity. Behind a TLS-terminating proxy, MeshCentral must be told the proxy's certificate.

Automatically, before they expire, provided port 80 remains reachable and DNS still points at the server.

Yes. Staging follows the same process without production rate limits, so problems can be fixed safely before requesting a trusted certificate.

Conclusion

A trusted certificate is one of the simplest and most valuable improvements you can make to a MeshCentral server. Point a real domain at the server, open port 80, configure the built-in Let's Encrypt support, prove it against staging and then switch to production. Understand the difference between the web certificate browsers see and the identity agents trust, take extra care when a reverse proxy is involved and protect the keys in the data folder. Your users will see a clean, secure login page, and your agents will keep connecting without interruption.