I'm running an instance of the official Traefik 2.4.9 docker image with two cert resolvers. Let's encrypt for public-facing services and Step CA for subdomains that only exist in the company-wide nameserver (such as Portainer and Traefik's dashboard). My traefik.toml looks as follows (redacted some names):
[global]
sendAnonymousUsage = false
[serversTransport]
rootCAs = ["/etc/traefik/acme.crt"]
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.https]
address = ":443"
[providers]
[providers.docker]
swarmMode = true
network = "traefik"
defaultRule = "Host(`{{ normalize .Name }}.docker.ourcompany.com`)"
[api]
dashboard = true
[certificatesResolvers]
[certificatesResolvers.letsencrypt]
[certificatesResolvers.letsencrypt.acme]
email = "traefik@ourcompany.com"
storage = "/etc/traefik/acme.json"
[certificatesResolvers.letsencrypt.acme.tlsChallenge]
[certificatesResolvers.step-ca]
[certificatesResolvers.step-ca.acme]
email = "traefik@ourcompany.com"
caServer = "https://docker.ourcompany.com:9001/acme/acme/directory"
storage = "/etc/traefik/step-ca_acme.json"
[certificatesResolvers.step-ca.acme.httpChallenge]
entryPoint = "http"
Some explanation for the less intuitive parts:
-
/etc/traefik/acme.crt
is the root cert that our Step CA uses. - Default resolver and http-to-https redirect are left out of the global config and configured on a per service basis.
- The only mounted volumes are
/var/run/docker.sock
and/etc/traefik
, so nothing that would interfere with/etc/ssl
(see Traefik can't connect to lets encrypt directory)
Services that get their cert through Step CA work without any problems but when I set a service to use Let's Encrypt, I get the following error:
time="2021-07-06T10:40:37Z" level=error msg="Unable to obtain ACME certificate for domains \"umfrage.hebrech.de\": cannot get ACME client get directory at 'https://acme-v02.api.letsencrypt.org/directory': Get \"https://acme-v02.api.letsencrypt.org/directory\": x509: certificate signed by unknown authority" providerName=letsencrypt.acme rule="Host(`survey.ourcompany.com`)" routerName=limesurvey-web-secure@docker
Here are my service labels:
traefik.http.routers.limesurvey-web-secure.entrypoints=https
traefik.http.routers.limesurvey-web-secure.rule=Host(`survey.ourcompany.com`)
traefik.http.routers.limesurvey-web-secure.tls.certresolver=letsencrypt
traefik.http.routers.limesurvey-web.entrypoints=http
traefik.http.routers.limesurvey-web.middlewares=redirect-to-https
traefik.http.routers.limesurvey-web.rule=Host(`survey.ourcompany.com`)
traefik.http.services.limesurvey-service.loadbalancer.server.port=80
Opening a shell in the container and accessing https://acme-v02.api.letsencrypt.org/directory
through wget
(curl
is not installed) works fine so it's not a problem of the company firewall redirecting us somewhere. It doesn't seem to be a general problem with Traefik either as a different server with the same version that doesn't have Step CA configured works without any problems.
I've tried the following:
- Added the right root cert for Let's Encrypt to
rootCAs
- Added
insecureSkipVerify = true
- Added
insecureSkipVerify = true
and removedrootCAs
completely
Nothing seems to work, what am I missing?