# Custom certificate not been picked up

**URL:** <https://community.traefik.io/t/custom-certificate-not-been-picked-up/4725>\
**Category:** Traefik v2\
**Tags:** docker\
**Created:** [March 2, 2020, 11:43pm UTC](https://community.traefik.io/t/custom-certificate-not-been-picked-up/4725 "2020-03-02T23:43:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sekar-fa](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/sekar-fa/32/1678_2.png) [@sekar-fa](https://community.traefik.io/u/sekar-fa)\
**Post date:** [March 2, 2020, 11:43pm UTC](https://community.traefik.io/t/custom-certificate-not-been-picked-up/4725/1 "2020-03-02T23:43:07Z")

</div>

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,

```auto
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,

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

```

---

<div class="post-metadata">

**Author:** ![ldez](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/ldez/32/5_2.png) [@ldez](https://community.traefik.io/u/ldez)\
**Post date:** [March 2, 2020, 11:55pm UTC](https://community.traefik.io/t/custom-certificate-not-been-picked-up/4725/2 "2020-03-02T23:55:47Z")

</div>

Hello,

`traefik.toml` contains the static configuration.

The [dynamic configuration](https://docs.traefik.io/v2.1/getting-started/configuration-overview/#the-dynamic-configuration) and the [static configuration](https://docs.traefik.io/v2.1/getting-started/configuration-overview/#the-static-configuration) must be defined in separated files:

---

<div class="post-metadata">

**Author:** ![sekar-fa](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/sekar-fa/32/1678_2.png) [@sekar-fa](https://community.traefik.io/u/sekar-fa)\
**Post date:** [March 3, 2020, 12:21am UTC](https://community.traefik.io/t/custom-certificate-not-been-picked-up/4725/3 "2020-03-03T00:21:27Z")

</div>

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

1. In my docker compose

```auto
    volumes:
       - $PWD/traefik.toml:/etc/traefik/traefik.toml
       - $PWD/config.yaml:/etc/traefik/config.yaml
       - $PWD:/etc/traefik/conf

```

1. In my traefik.toml

```auto
[providers]
  [providers.file]
    filename = "/etc/traefik/config.yaml"
    watch = true

```

1. In the config.yam i have the below,

```auto
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

---

<div class="post-metadata">

**Author:** ![metadata](https://avatars.discourse-cdn.com/v4/letter/m/e36b37/32.png) [@metadata](https://community.traefik.io/u/metadata)\
**Post date:** [March 3, 2020, 5:03am UTC](https://community.traefik.io/t/custom-certificate-not-been-picked-up/4725/4 "2020-03-03T05:03:59Z")

</div>

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.

> <https://gist.github.com/prayagsingh/ee85e81dd03191f14c459b6d38b4af15>

---

<div class="post-metadata">

**Author:** ![sekar-fa](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/sekar-fa/32/1678_2.png) [@sekar-fa](https://community.traefik.io/u/sekar-fa)\
**Post date:** [March 3, 2020, 10:43pm UTC](https://community.traefik.io/t/custom-certificate-not-been-picked-up/4725/5 "2020-03-03T22:43:33Z")

</div>

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