Default TLS should specificly be in "file" provider?

Hi folks!

I'm using Traefik for a while and I would migrate to traefik v2.

I'm pretty confident with the usage of Traefik but something is making me lose my mind.
I want to set a default certificate on my traefik server but I can't figure out why I have to configure it in the File provider.

Let me explain.

I have my main configuration file "traefik.v2.yaml" with :

debug: false
accessLog: {}
log:
  level: DEBUG 

api: 
  insecure: true
  dashboard: true
  debug: true

entryPoints:
  web:
    address: ':80'
  web-secure:
    address: ':443'
tls:
 stores:
   default:
      defaultCertificate:
        certFile: /path/to/my/cert.pem
        keyFile: /path/to/my/privkey.pem

providers:
  file:
    watch: true
    filename: ./rules.yml
    debugLogGeneratedTemplate: true
  docker:
    endpoint: "unix:///var/run/docker.sock"

And my rules:

http:
  routers:
    cloud:
      entryPoints:
        - 'web'
        - 'web-secure'
      rule: 'Host(`my.domain.tld`)'
      service: 'cloud'
      tls: {}
  services:
    cloud:
      loadBalancer:
        passHostHeader: true
        servers:
          - url: 'http://endpoint.tld/'

With this configuration the default TLS configuration is not set :

DEBU[2019-09-18T17:40:14+02:00] No default certificate, generating one                                                                                                                                                                      

But if I move the TLS section into my "rules.yaml" there is a default TLS.

Why should I set the default tls cert into the File provider?

Is it a bad configuration from my side?
Any help to make me understand better would be appreciate :slight_smile:

the tls configuration must be placed in the dynamic configuration

Yes the only way to define the TLS section in the dynamic configuration is from the file provider.

Thanks for the quick reply.

It's kind of weird in my opinion but thanks for explanation :slight_smile: