Error while creating certificate store: failed to load X509 key pair: tls: failed to find any PEM data in key input" tlsStoreName=default

I try to using my SSL in Traefik. But, I have error below, somebody help me why domain.cert and domain.key can't not verify.


This is my traefik.yml

api:
  dashboard: true
  insecure: true

log:
  level: ERROR

entryPoints:
  web:
    # http
    address: ":80"
    http:
      # https://docs.traefik.io/routing/entrypoints/#entrypoint
      redirections:
        entryPoint:
          to: web-secure

  web-secure:
    # https
    address: ":443"
    http:
      tls:
        options: default

  flower:
    address: ":5555"

  portainer:
    address: ":9443"

http:
  routers:
    web-secure-router:
      rule: "Host(`gae-gw.systems`) || Host(`www.gae-gw.systems`)"
      entryPoints:
        - web-secure
      middlewares:
        - csrf
      service: django


    flower-secure-router:
      rule: "Host(`gae-gw.systems`)"
      entryPoints:
        - flower
      service: flower


    portainer-secure-router:
      rule: "Host(`gae-gw.systems`)"
      entryPoints:
        - portainer
      service: portainer

  middlewares:
    csrf:
      # https://docs.traefik.io/master/middlewares/headers/#hostsproxyheaders
      # https://docs.djangoproject.com/en/dev/ref/csrf/#ajax
      headers:
        accessControlAllowOriginList: ["*"]
        hostsProxyHeaders: ["X-CSRFToken"]

  services:
    django:
      loadBalancer:
        servers:
          - url: http://django:5000

    flower:
      loadBalancer:
        servers:
          - url: http://flower:5555

    portainer:
      loadBalancer:
        servers:
          - url: http://portainer:9443

tls:
  certificates:
    - certFile: "/etc/traefik/acme/gae-gw-systems.cert"
      keyFile: "/etc/traefik/acme/gae-gw-systems.key"
      stores:
        - default
  options:
    default:
      minVersion: VersionTLS12
      maxVersion: VersionTLS13
  stores:
      default:
        defaultCertificate:
          certFile: "/etc/traefik/acme/gae-gw-systems.cert"
          keyFile: "/etc/traefik/acme/gae-gw-systems.key"

providers:
  # https://docs.traefik.io/master/providers/file/
  file:
    filename: /etc/traefik/traefik.yml
    watch: true

My docker compose:

  traefik:
    build:
      context: .
      dockerfile: ./compose/production/traefik/Dockerfile
    image: erp_greenwich_production_traefik
    depends_on:
      - django
    volumes:
      - production_traefik:/etc/traefik/acme:z
    ports:
      - "0.0.0.0:80:80"
      - "0.0.0.0:443:443"
      - "0.0.0.0:5555:5555"

Hello!

Thanks for using Traefik.

At the first glance, you are mixing static with dynamic configuration. Please have a look at the docs to learn more about the differences between those two types of configuration.

Can you please split the configuration accordingly and try again to see if the error still exists?

Thanks,