r/Traefik•
clevarius

Traefik 2.2.8 always servs the default certificate

Traefik 2.2.8 always servs the default certificate with this configuration:

[entryPoints]
  [entryPoints.https]
    address = ":8001"
 
[[tls.certificates]]
   certFile = "/[...]/x1.y1.z1.crt"
   keyFile = "/[...]/x1.y1.z1.key"
[[tls.certificates]]
   certFile = "/[...]/x2.y2.z2.crt"
   keyFile = "/[...]/x2.y2.z2.key"

  <a dozen more certificates>

[http.routers.1]
   entryPoints = ["https"]
   service = "1"
   rule = "Host(`x1.y1.z1`)"

[http.routers.1.tls]
   [[http.routers.1.tls.domains]]
     sans = ["x1.y1.z1"]

[http.services.1]
  [http.services.1.loadBalancer]
    [[http.services.1.loadBalancer.servers]]
      url = "http://internal:10012" 

I migrated from V1 so I am sure the certificates work. And even adding SANs for the router doesn't help. Help is highly appreciated!!!

Posted Aug 17, 2020, 11:16 AM UTC · edited

34
EmiiKhaos•

Logs? At least info level or debug

1
czuk•

Where you store your certs/keys needs to be mounted as a volume in the traefik container.

1
czuk•

tls.yml in my rules folder

tls:
  stores:
    default:
      defaultCertificate:
        certFile: /certs/fqdn.chain.crt
        keyFile: /certs/fqdn.key

Volumes section from docker-compose.yml

volumes:
  - ./rules:/rules
  - /var/run/docker.sock:/var/run/docker.sock:ro
  - ./acme.json:/acme.json
  - ./traefik.log:/traefik.log
  - ./certs:/certs
1
clevariusOP•

The point was that certificates can't bei configured statically. You must include the certs with a provider. It isn't mentioned anywhere.

1