Custom certificate not been picked up

Issue: self signed certificate is not getting picked up as i need to use a default certificate for all the incoming traffic for any domain.
log says msg="No default certificate, generating one"

Below is the traefik version,

Version:      2.1.4
Codename:     cantal
Go version:   go1.13.7
Built:        2020-02-06T17:10:06Z
OS/Arch:      linux/amd64

In the traefik.toml dynamic configuration below is the configuration,

[tls.stores]
  [tls.stores.default]
    [tls.stores.default.defaultCertificate]
      certFile = "/etc/traefik/conf/cert.crt"
      keyFile  = "/etc/traefik/conf/cert.key"

Hello,

traefik.toml contains the static configuration.

The dynamic configuration and the static configuration must be defined in separated files:

Thanks for the reply,
I have the both the config file,

  1. In my docker compose
    volumes:
       - $PWD/traefik.toml:/etc/traefik/traefik.toml
       - $PWD/config.yaml:/etc/traefik/config.yaml
       - $PWD:/etc/traefik/conf
  1. In my traefik.toml
[providers]
  [providers.file]
    filename = "/etc/traefik/config.yaml"
    watch = true
  1. In the config.yam i have the below,
tls:
  certificates:
    - certFile: /etc/traefik/conf/cert.crt
      keyFile: /etc/traefik/conf/cert.key
      stores:
        - default
  stores:
    default:
      defaultCertificate:
        certFile: /etc/traefik/conf/cert.crt
        keyFile: /etc/traefik/conf/cert.key

earlier i had the tls specified in the static file(traefik.toml) now moved it to the dynamic file(config.yaml)

In this correct

Hey @sekar-fa, u can refer to below gist. proxy-config.toml contains dynamic configuration only. it uses both letsencrypt and custom tls certs for two different domains.

When i moved the tls entry from static file to dynamic file, it worked.
Thanks @ldez @metadata

1 Like