Custom Wildcard certificate in Traefik 2

Hi Folks,

I am trying to get started with Traefik 2, and launch the default dashboard with the custom wildcard certificate for the domain which i already have access to. But every time, i navigate to dashboard, i am getting the cerificate error, as it's taking the default certificate.

Here is my traefik directory -
├── data
│ ├── certs
│ │ ├── server.crt
│ │ └── server.key
│ └── traefik.yml
└── docker-compose.yml

Trafik.yml is -

api:
  dashboard: true

entryPoints:
  http:
    address: ":80"
  https:
    address: ":443"

tls:
    certificates:
        - certFile: /certs/server.crt
          keyFile: /certs/server.key

providers:
  docker:
    endpoint: "unix:///var/run/docker.sock"
    exposedByDefault: false

docker-compose.yml file is -

version: '3'

services:
  traefik:
    image: traefik:latest
    container_name: traefik
    security_opt:
      - no-new-privileges:true
    networks:
      - proxy
    ports:
      - 80:80
      - 443:443
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./data/traefik.yml:/traefik.yml:ro
      - ./data/certs/server.crt:/certs/server.crt
      - ./data/certs/server.key:/certs/server.key
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.traefik.entrypoints=http"
      - "traefik.http.routers.traefik.rule=Host(`monitor1.domainname.com`)"
      - "traefik.http.middlewares.traefik-auth.basicauth.users=admin:$$apr1$$6Tx6OsP9$$KQwpArtkRwMfWrILs1wbW/"
      - "traefik.http.middlewares.traefik-https-redirect.redirectscheme.scheme=https"
      - "traefik.http.routers.traefik.middlewares=traefik-https-redirect"
      - "traefik.http.routers.traefik-secure.entrypoints=https"
      - "traefik.http.routers.traefik-secure.rule=Host(`monitor1.domainname.com`)"
      - "traefik.http.routers.traefik-secure.middlewares=traefik-auth"
      - "traefik.http.routers.traefik-secure.tls=true"
      - "traefik.http.routers.traefik-secure.service=api@internal"

networks:
  proxy:
    external: true

Please help me know what I am doing wrong.

Cheers!

Look for hints in the debug log.

Thanks, but i have figured it out by modifying the traefik.yml (by moving tls to another file), and adding double quotes while providing path to the certificate.

tls:
    certificates:
        - certFile: "/certs/server.crt"
          keyFile: "/certs/server.key"