Wildcard certificates are working for my default certResolver. However, when adding a second certResolver (because I want a different keyType), the second certResolver never resolves, I get the wildcard certificate from the default certResolver.
- I have services on
http
working beautifully. Subdomains go to the right places. - I have services on
https
working beautifully. The wildcard certificate is being properly generated and renewed. All services that are on this entryPoint have the wildcard certificate as expected. - The problem is the
https-alternate
entrypoint. All services here should have individual certificates, NOT wildcard certificates.
I want the https-alternate
entrypoint to have certificates from the rsa2048
resolver, however, this is not occuring. When I visit a site that is on the https-alternate
resolver, I get the wildcard certificate from the https
resolver and acme.rsa2048.json
file is empty.
Where is my issue? How can I get NON-wildcard certificates on my https-alternate entrypoint?
traefik.yml
entryPoints:
http:
address: ":80"
https:
address: ":443"
https-alternate:
address: ":4443"
http:
tls:
certResolver: rsa2048
certificatesResolvers:
https:
acme:
email: acme@domain.local
storage: /data/acme.json
httpChallenge:
entryPoint: http
rsa2048:
acme:
keytype: RSA2048
email: acme@domain.local
storage: /data/acme.rsa2048.json
httpChallenge:
entryPoint: http
service.traefik.yml
(Docker Swarm Service)
labels:
- "traefik.enable=true"
- "traefik.http.routers.traefik-secure.entrypoints=https"
- "traefik.http.routers.traefik-secure.rule=Host(`traefik.domain.local`)"
- "traefik.http.routers.traefik-secure.tls=true"
- "traefik.http.routers.traefik-secure.tls.certresolver=https"
- "traefik.http.routers.traefik-secure.tls.domains[0].main=*.domain.local"
- "traefik.http.routers.traefik-secure.tls.domains[0].sans=domain.local"
- "traefik.http.routers.traefik-secure.service=api@internal"
- "traefik.http.services.traefik.loadbalancer.server.port=8080"
service.testing.yml
(Docker Swarm Service)
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik"
- "traefik.http.routers.svc1.entrypoints=http"
- "traefik.http.routers.svc1.rule=Host(`subdomain.domain.local`)"
- "traefik.http.routers.svc1.service=testservice"
- "traefik.http.routers.svc1s.entrypoints=https-alternate"
- "traefik.http.routers.svc1s.rule=Host(`subdomain.domain.local`)"
- "traefik.http.routers.svc1s.tls=true"
- "traefik.http.routers.svc1s.tls.domains[0].main=subdomain.domain.local"
- "traefik.http.routers.svc1s.tls.certresolver=rsa2048"
- "traefik.http.routers.svc1s.service=testservice"
- "traefik.http.services.testservice.loadbalancer.server.port=80"
traefik.log
{"level":"info","msg":"Starting provider *file.Provider {\"watch\":true,\"filename\":\"/data/tls.yml\"}","time":"2020-09-05T17:40:40-04:00"}
{"level":"info","msg":"Starting provider *acme.Provider {\"email\":\"acme@domain.local\",\"caServer\":\"https://acme-v02.api.letsencrypt.org/directory\",\"storage\":\"/data/acme.json\",\"keyType\":\"RSA4096\",\"httpChallenge\":{\"entryPoint\":\"http\"},\"ResolverName\":\"https\",\"store\":{},\"ChallengeStore\":{}}","time":"2020-09-05T17:40:40-04:00"}
{"level":"info","msg":"Testing certificate renew...","providerName":"http.acme","time":"2020-09-05T17:40:40-04:00"}
{"level":"info","msg":"Starting provider *docker.Provider {\"watch\":true,\"endpoint\":\"unix:///var/run/docker.sock\",\"defaultRule\":\"Host(`{{ normalize .Name }}`)\",\"swarmMode\":true,\"network\":\"traefik\",\"swarmModeRefreshSeconds\":15000000000}","time":"2020-09-05T17:40:40-04:00"}
{"level":"info","msg":"Starting provider *traefik.Provider {}","time":"2020-09-05T17:40:40-04:00"}
{"level":"info","msg":"Starting provider *acme.Provider {\"email\":\"acme@domain.local\",\"caServer\":\"https://acme-v02.api.letsencrypt.org/directory\",\"storage\":\"/data/acme.rsa2048.json\",\"keyType\":\"RSA2048\",\"httpChallenge\":{\"entryPoint\":\"http\"},\"ResolverName\":\"rsa2048\",\"store\":{},\"ChallengeStore\":{}}","time":"2020-09-05T17:40:40-04:00"}
{"level":"info","msg":"Testing certificate renew...","providerName":"rsa2048.acme","time":"2020-09-05T17:40:40-04:00"}
traefik version
Version: 2.2.10
Codename: chevrotin
Go version: go1.14.8
Built: 2020-09-04T15:53:27Z
OS/Arch: linux/amd64