Using letsencrypt certificates and custom ones simultaneously


I'm trying to build a setup using tls certificates from letsencrypt and custom certificates simultaneously (of course in different services).
The letsencrypt certificate will only be valid for and my custom one only for

Therefore I used this letsencrypt config in my static config file:

    email = ""
    storage = "acme.json"

And in my dynamic config I specified the custom certificate:

      minVersion = "..."
      cipherSuites = [...]
      curvePreferences = [...]
      sniStrict = true
    certFile = "/etc/traefik/cert.pem"
    keyFile = "/etc/traefik/priv.pem"

Now I build a docker file with two different containers, one with a letsencrypt certificate and the other one with my custom certificate.

    image: containous/whoami
        - traefik.enable=true
        - traefik.http.routers.ssltest-letsencrypt.rule=Host(``)
        - traefik.http.routers.ssltest-letsencrypt.entrypoints=https
        - traefik.http.routers.ssltest-letsencrypt.tls=true
        - traefik.http.routers.ssltest-letsencrypt.tls.certresolver=letsencrypt
    image: containous/whoami
        - traefik.enable=true
        - traefik.http.routers.ssltest-custom.rule=Host(``)
        - traefik.http.routers.ssltest-custom.entrypoints=https
        - traefik.http.routers.ssltest-custom.tls=true

If I deploy this file, the container using the custom tls certificate (at is working as expected using my custom certFile. When I try to access the container using the letsencrypt (at certificate, I got an error meaning that the certificate is not valid for this subdomain.
A quick look in to the logs indicated, the letsencrypt container is indeed using my custom tls certificate. Letsencrypt was not requested to issue a certificate for

Now I thought this use case could not work, cause I override the [tls.certificates] property for my custom certificate so letsencrypt will be ignored. But I proved me quickly wrong: If i manually add the letsencrypt certificate for the mentioned subdomain to acme.json the letsencrypt container is working as expected. So it seems if traefik.http.routers.x.tls.certresolver is specified, the custom tls certificate will be ignored. This's as I expected.

So my question is:
Is it possible to use letsencrypt and custom tls certificates in one traefik instance simultaneously? If yes, what I'm doing wrong?
Or is this more indicating a kind of bug? If I manually imitating the letsencrypt service by pasting the correct certificate to "acme.json" everything is working as expected...

Feel free to answer with a question if some detailed information is missing or if I should create a issue over in GitHub.


Edit: Fixed wrong router name.

Yes you can.

This is set exactly the same in both your containers(wrong router name in both). But if this is the problem then I am not sure how either of them would be working.

This already sounds promising, that I cloud use letsencrypt certificated and custom tls certificates simultaneously.

The wrong router name is indeed a copy & paste error - I've corrected these mistake.

Are you using docker swarm ?

Yes, traefik is configured to use docker swarm.