Traefik returns wrong certificate for resource on base domain of a domain with a wildcard #1699

Closed
opened 2026-04-05 19:39:42 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @whitestrake on 3/18/2025

I have multiple domains configured in config.yml with prefer_wildcard_cert = true.

When I configure a resource to be accessible on a Base Domain and browse to the resource:

  • Traefik INFO logging produces Serving default certificate for request: "example.com"
  • My reverse proxy ERROR logging produces: tls: failed to verify certificate: x509: certificate is valid for d3259985ff8eac269f203e3f153d5dfd.a27506fe422f898b674a2d53ace62341.traefik.default, not example.com

I'd expect instead that it acquires and returns a valid certificate for example.com itself, instead of one that I assume is a self-signed fallback.

It seems like Traefik isn't being configured correctly for these Base Domain resources. When I check the output of http://pangolin:3001/api/v1/traefik-config I see a tls.domains.main field equal to the wildcard rather than the actual base domain itself, which seems appropriate for a subdomain resource but not a Base Domain resource - could that be an issue here?

      "4-router": {
        "entryPoints": [
          "websecure"
        ],
        "middlewares": [
          "badger"
        ],
        "service": "4-service",
        "rule": "Host(`example.com`)",
        "tls": {
          "certResolver": "letsencrypt",
          "domains": [
            {
              "main": "*.example.com"
            }
          ]
        }
      },
*Originally created by @whitestrake on 3/18/2025* I have multiple domains configured in `config.yml` with `prefer_wildcard_cert = true`. When I configure a resource to be accessible on a Base Domain and browse to the resource: - Traefik INFO logging produces `Serving default certificate for request: "example.com"` - My reverse proxy ERROR logging produces: `tls: failed to verify certificate: x509: certificate is valid for d3259985ff8eac269f203e3f153d5dfd.a27506fe422f898b674a2d53ace62341.traefik.default, not example.com` I'd expect instead that it acquires and returns a valid certificate for `example.com` itself, instead of one that I assume is a self-signed fallback. It seems like Traefik isn't being configured correctly for these Base Domain resources. When I check the output of `http://pangolin:3001/api/v1/traefik-config` I see a `tls.domains.main` field equal to the wildcard rather than the actual base domain itself, which seems appropriate for a subdomain resource but not a Base Domain resource - could that be an issue here? ``` "4-router": { "entryPoints": [ "websecure" ], "middlewares": [ "badger" ], "service": "4-service", "rule": "Host(`example.com`)", "tls": { "certResolver": "letsencrypt", "domains": [ { "main": "*.example.com" } ] } }, ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/pangolin#1699