Traefik + MongoDB with TLS

Hello, I was wondering if anyone has figured out how to use a Traefik TCP Router and a Let's Encrypt certificate with MongoDB. I previously used MongoDB with no TLS and a hostSNI wildcard (which I would rather not do).

What’s your challenge with the setup?

Use certresolver in static config and use TCP router (rule=HostSNI(``)) with a service, set loadbalancer.server.port in dynamic configuration.

Note that httpresolver only works on external port 80 and tlsresolver only works on external port 443. If you want to use a different external port, then you need dnsresolver.