DEV Community

Cover image for TRAEFIK DEFAULT CERT Is Not an Error Message: Diagnosing DNS and TLS on a VPS
hoagminh
hoagminh

Posted on

TRAEFIK DEFAULT CERT Is Not an Error Message: Diagnosing DNS and TLS on a VPS

Almost everyone who has self-hosted an application behind Traefik has seen the same browser screen:

Your connection is not private
NET::ERR_CERT_AUTHORITY_INVALID
Issuer: TRAEFIK DEFAULT CERT
Enter fullscreen mode Exit fullscreen mode

The browser tells you the certificate is untrusted. It does not tell you why Let's Encrypt failed to issue one.

Maybe the domain has no DNS record yet. Maybe the A record points to the right VPS, while a forgotten AAAA record still points to an old server. Maybe port 443 is blocked by a firewall. Maybe the domain is behind a Cloudflare Tunnel where an A record makes no sense at all. Maybe the certificate was issued—against Let's Encrypt's staging CA.

When you only show a generic red "HTTPS failed" badge, every one of those problems looks identical.

This is the problem behind domain and TLS diagnostics in Nitrobase.

Nitrobase has only recently launched and is still in Beta. Its domain checker registry does not replace full external uptime monitoring, and it cannot fix DNS records inside your registrar. Its job is narrower: probe the real DNS and TLS state so a self-hoster can see which layer broke in seconds instead of guessing.

Separate DNS, Tunnel, and TLS into independent checks

A domain route in Nitrobase passes through a small registry of checkers (dns, tunnel, cert), where each checker declares whether it applies to a given route:

Checker When it runs What it verifies
dns Public VPS routes (!viaTunnel) Resolves both A (IPv4) and AAAA (IPv6) records against the server's public IPs
tunnel Cloudflare Tunnel routes (viaTunnel) Reports the live cloudflared connector state instead of expecting a VPS A record
cert Any route with HTTPS enabled Performs a live TLS handshake on port 443 and inspects the peer certificate

That appliesTo split prevents a common false alarm. A domain routed through Cloudflare Tunnel uses a CNAME to Cloudflare's edge—it will never resolve to the VPS's public IP. Running a standard A-record check on a tunnel hostname would permanently show a false "DNS mismatch" error, so Nitrobase swaps the dns check for tunnel (connected, connecting, failing, stopped).

The stale AAAA record trap (dns_partial)

One of the sneakiest Let's Encrypt failures happens when migrating a domain from an old host to a new VPS.

You update the A record to the new IPv4 address. You run ping app.example.com from your laptop and see the new IP. Everything looks right—yet ACME certificate issuance keeps failing.

The culprit is often an old AAAA (IPv6) record left behind at the registrar. Let's Encrypt prefers IPv6 when an AAAA record exists, so the HTTP-01 challenge hits the old server while your IPv4 ping hits the new one.

Nitrobase resolves IPv4 and IPv6 in parallel (dns.resolve4 and dns.resolve6) and compares every returned address against the VPS's known public IPs:

Resolved DNS records vs. VPS public IPs:
  - 0 records returned            -> error:   dns_no_record
  - All records match server IPs  -> ok:      dns_ok
  - Some match, some don't        -> warning: dns_partial  (classic stale AAAA / old IP!)
  - None match server IPs         -> error:   dns_mismatch (shows resolved vs. expected)
Enter fullscreen mode Exit fullscreen mode

Surfacing dns_partial with both the resolved list and the matching subset turns a thirty-minute mystery into a ten-second fix.

Why the TLS probe deliberately uses rejectUnauthorized: false

If you test HTTPS with a standard fetch("https://app.example.com") or a strict tls.connect(), Node throws an opaque handshake error the moment a certificate is self-signed or expired. You learn that TLS failed, but you lose the certificate itself.

Nitrobase's certChecker opens a raw tls.connect() socket on port 443 with SNI (servername) set to the hostname and rejectUnauthorized: false—strictly for read-only certificate inspection, never for sending application requests or credentials:

tls.connect({ host, port: 443, servername, rejectUnauthorized: false })
        |
        v
Read socket.getPeerCertificate() + socket.authorized
        |
        +--> validTo < now                           -> error:   cert_expired
        +--> !authorized && /TRAEFIK DEFAULT CERT/   -> error:   cert_default
        +--> !authorized (other issuer/error)        -> error:   cert_untrusted
        +--> /STAGING|Fake LE/i.test(issuer)         -> warning: cert_staging
        +--> expires within warningDays              -> warning: cert_expiring
        +--> authorized & healthy                    -> ok:      cert_ok
Enter fullscreen mode Exit fullscreen mode

That single distinction between cert_default and cert_untrusted saves real time:

  • cert_default (TRAEFIK DEFAULT CERT): Traefik is reachable on port 443, which means your firewall and routing are working—ACME just hasn't finished issuing (or couldn't validate) the Let's Encrypt certificate yet.
  • cert_untrusted: Something else answered on port 443 (a misconfigured proxy, a self-signed origin cert, or a wrong host).
  • cert_unreachable: The TCP/TLS connection timed out or refused connection entirely—check port 443 firewall rules or whether Traefik is running.
  • cert_staging: HTTPS appears to work in some tools, but the certificate came from Let's Encrypt's staging CA (Fake LE) and browsers will reject it.
  • cert_expiring: The certificate is valid today, but approaching expiration—giving you early warning if automated renewal stopped working.

Testing real HTTPS before buying a domain

Sometimes you just want to deploy an app on a fresh VPS and verify HTTPS end-to-end without touching a registrar first.

Nitrobase supports zero-setup wildcard DNS providers (sslip.io for IPv4/IPv6 and nip.io for IPv4), turning a server IP like 203.0.113.10 into a resolvable hostname (my-app.203-0-113-10.sslip.io) automatically. Combined with a real ACME email (ACME_EMAIL, falling back to the admin's account email rather than placeholder domains like example.com that Let's Encrypt rejects), you can test live TLS certificates immediately on a brand-new server.

What domain checks still cannot see

DNS propagation is global and cached by recursive resolvers. A check running from the Nitrobase control plane sees what its resolver sees—your local ISP or Let's Encrypt's multi-perspective validation servers may still hold a cached record for a few minutes.

Likewise, certChecker verifies the certificate presented on port 443, not whether the application container behind Traefik is returning HTTP 200 (which belongs to application health checks).

My checklist when HTTPS won't issue on a VPS

  • [ ] Do both A and AAAA records point exclusively to this VPS (no leftover IPv6 record)?
  • [ ] Is the domain routed through Cloudflare Tunnel instead of direct public ports?
  • [ ] Is port 443 (and 80 for HTTP-01 challenges) open on the host and cloud firewall?
  • [ ] Is Traefik returning TRAEFIK DEFAULT CERT (ACME pending/failed) or is another service answering?
  • [ ] Is the ACME account configured with a real, non-placeholder email address?
  • [ ] Is the issued cert from production Let's Encrypt rather than Fake LE staging?
  • [ ] Will you notice before expiry if renewal breaks 60 days from now?

Good diagnostics don't make TLS magic. They just replace "connection not private" with the exact reason so you know which screen to open next.

Nitrobase source code: https://github.com/AydenGroup/nitrobase

Top comments (0)