# Failed to register default certificate on traefik

**URL:** <https://community.traefik.io/t/failed-to-register-default-certificate-on-traefik/14695>\
**Category:** Traefik v2\
**Tags:** file\
**Created:** [June 7, 2022, 5:18am UTC](https://community.traefik.io/t/failed-to-register-default-certificate-on-traefik/14695 "2022-06-07T05:18:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![siddiq-rehman](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/siddiq-rehman/32/5438_2.png) [@siddiq-rehman](https://community.traefik.io/u/siddiq-rehman)\
**Post date:** [June 7, 2022, 5:18am UTC](https://community.traefik.io/t/failed-to-register-default-certificate-on-traefik/14695/1 "2022-06-07T05:18:13Z")

</div>

Hello together,

I have been trying to setup a default certificate to the traefik through file provider. I have added this as .yaml file,

tls:  
stores:  
default:  
defaultCertificate:  
certFile: /data/config/tls.crt  
keyFile: /data/config/tls.key

The paths defined for cert is absolute path and once this file I am providing I am getting an error like below,

time="2022-06-07T05:12:32Z" level=error msg="Error during the build of the default TLS configuration: TLS store default not found" entryPointName=traefik  
time="2022-06-07T05:12:32Z" level=error msg="Error during the build of the default TLS configuration: TLS store default not found" entryPointName=web  
time="2022-06-07T05:12:32Z" level=error msg="Error during the build of the default TLS configuration: TLS store default not found" entryPointName=websecure  
time="2022-06-07T05:12:32Z" level=error msg="Error during the build of the default TLS configuration: TLS store default not found" entryPointName=metrics.

Need some help!!! Thanks in advance.

PS: I am using v2.5.3 of traefik

---

<div class="post-metadata">

**Author:** ![mloiseleur](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/mloiseleur/32/4987_2.png) [@mloiseleur](https://community.traefik.io/u/mloiseleur)\
**Post date:** [June 7, 2022, 7:30am UTC](https://community.traefik.io/t/failed-to-register-default-certificate-on-traefik/14695/2 "2022-06-07T07:30:06Z")

</div>

This error message come from [this code](https://github.com/traefik/traefik/blob/master/pkg/tls/tlsmanager.go#L133). It happens during the build of your store. It means Traefik cannot build it.

You may have an other error message explaining why. It may mean your cert files are not accessible. You have to use the path inside the container, not host path. For example, if you mount volumes like this :

```auto
 - "/data/config/:/config/

```

Then your path to cert should look like this

```auto
# Dynamic configuration
tls:
  stores:
    default:
      defaultCertificate:
        certFile: /config/tls.crt
        keyFile: /config/tls.key

```

Btw, you have a recent, full and detailed example on how to do it on [Traefik Blog](https://traefik.io/blog/traefik-2-tls-101-23b4fbee81f1/).

---

<div class="post-metadata">

**Author:** ![siddiq-rehman](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/siddiq-rehman/32/5438_2.png) [@siddiq-rehman](https://community.traefik.io/u/siddiq-rehman)\
**Post date:** [June 9, 2022, 1:38pm UTC](https://community.traefik.io/t/failed-to-register-default-certificate-on-traefik/14695/3 "2022-06-09T13:38:16Z")

</div>

Hi, Thanks for the reply,

I have a pod running in kubernetes cluster with a pvc mounted at "/data" inside the traefix container, So, I am trying to load the certificates from there. I find no luck doing that. I am trying this with self signed certificate

I am registered to load dynamic config from "/data/config/tls\_config.yaml" and in that I have the path like "/data/config/tls.\*"

Moreover i see this error message when I try to load the page.

> time="2022-06-09T13:43:58Z" level=debug msg="http: panic serving 10.6.0.91:46552: runtime error: invalid memory address or nil pointer dereference"  
> time="2022-06-09T13:43:58Z" level=debug msg="goroutine 855704 [running]:"  
> time="2022-06-09T13:43:58Z" level=debug msg="net/http.(\*conn).serve.func1()"  
> time="2022-06-09T13:43:58Z" level=debug msg="\t/usr/local/golang/1.10.8/go/src/net/http/server.go:1801 +0xb9"  
> time="2022-06-09T13:43:58Z" level=debug msg="panic({0x2d787c0, 0x59307b0})"  
> time="2022-06-09T13:43:58Z" level=debug msg="\t/usr/local/golang/1.10.8/go/src/runtime/panic.go:1047 +0x266"  
> time="2022-06-09T13:43:58Z" level=debug msg="[github.com/traefik/traefik/v2/pkg/tls.(\*Manager).Get.func1(0xc000beadd0)](http://github.com/traefik/traefik/v2/pkg/tls.(*Manager).Get.func1(0xc000beadd0))"  
> time="2022-06-09T13:43:58Z" level=debug msg="\t/home/semaphore/go/src/github.com/traefik/traefik/pkg/tls/tlsmanager.go:162 +0x1be"

---

<div class="post-metadata">

**Author:** ![mloiseleur](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/mloiseleur/32/4987_2.png) [@mloiseleur](https://community.traefik.io/u/mloiseleur)\
**Post date:** [June 10, 2022, 7:12am UTC](https://community.traefik.io/t/failed-to-register-default-certificate-on-traefik/14695/4 "2022-06-10T07:12:27Z")

</div>

Do you have same behavior with v2.5.7 ? or superior ?

---

<div class="post-metadata">

**Author:** ![marcosadsj](https://avatars.discourse-cdn.com/v4/letter/m/bbce88/32.png) [@marcosadsj](https://community.traefik.io/u/marcosadsj)\
**Post date:** [March 8, 2023, 8:56pm UTC](https://community.traefik.io/t/failed-to-register-default-certificate-on-traefik/14695/5 "2023-03-08T20:56:41Z")

</div>

```auto
tls:
  stores:
    default:
      defaultCertificate:
        - certFile: /config/tls.crt # you might put the "-" at begining
          keyFile: /config/tls.key

```
