# Manually update SSL certificates

**URL:** <https://community.traefik.io/t/manually-update-ssl-certificates/13665>\
**Category:** Traefik v2\
**Tags:** docker\
**Created:** [March 4, 2022, 2:23pm UTC](https://community.traefik.io/t/manually-update-ssl-certificates/13665 "2022-03-04T14:23:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jwillmer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/jwillmer/32/3978_2.png) [@jwillmer](https://community.traefik.io/u/jwillmer)\
**Post date:** [March 4, 2022, 2:23pm UTC](https://community.traefik.io/t/manually-update-ssl-certificates/13665/1 "2022-03-04T14:23:15Z")

</div>

I have setup traffic to use a certificate that I provide in a folder. So far that works when defining the cert as default - didn't manage to bind it only to `https` endpoint . The setup looks like this:

```auto
    traefik-test:
        image: traefik:v2.5
        container_name: traefik-test
        restart: always
        command:
            - "--log.level=DEBUG"
            - "--api=true"
            - "--api.dashboard=true"
            - "--api.insecure=true"      
            - "--providers.docker=true"
            - "--providers.docker.exposedbydefault=false"
            - "--providers.docker.network=traefik_proxy_test"  
            - "--serversTransport.insecureSkipVerify=true"    
            - "--entrypoints.https.address=:443"                 
            - "--providers.file=true"
            - "--providers.file.filename=/dyn/dynamic.toml"
        networks:
            - traefik_proxy_test
        ports:       
            - "444:443"
            - "8082:8080"
        volumes:
            - ${USERDIR}/docker/traefik/ssl:/etc/traefik/ssl
            - ${USERDIR}/docker/traefik/dyn:/dyn
            - /var/run/docker.sock:/var/run/docker.sock:ro            
        labels:
          - "traefik.enable=true"
          - "traefik.docker.network=traefik_proxy_test"
          - "traefik.http.routers.traefik.rule=Host(`test.${DOMAINNAME}`)"
          - "traefik.http.routers.traefik.entrypoints=https"
          - "traefik.http.routers.traefik.service=api@internal"
          - "traefik.http.routers.traefikloadbalancer.server.port=8080"

```

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

```

However refreshing the certificate by replacing the files does not work. I need to restart traefik to recognize the new certificates. Is there a better way to make traefik aware of updated certificates? I don't like to terminate my users.

---

<div class="post-metadata">

**Author:** ![tommoulard](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/tommoulard/32/2997_2.png) [@tommoulard](https://community.traefik.io/u/tommoulard)\
**Post date:** [March 7, 2022, 3:55pm UTC](https://community.traefik.io/t/manually-update-ssl-certificates/13665/2 "2022-03-07T15:55:49Z")

</div>

Hello @jwillmer,

As `tls.stores.default.defaultCertificate` are part of the dynamic traefik configuration, there is no need to restart traefik to update this configuration.

What's maybe your issue is the usage of `--providers.file.filename`. We recomand using `--providers.file.directory` as it has a better FS handler.

---

<div class="post-metadata">

**Author:** ![jwillmer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/jwillmer/32/3978_2.png) [@jwillmer](https://community.traefik.io/u/jwillmer)\
**Post date:** [March 9, 2022, 12:08pm UTC](https://community.traefik.io/t/manually-update-ssl-certificates/13665/3 "2022-03-09T12:08:57Z")

</div>

I ended up modifying the path to the certificates every time a new one is provided. This way traefik recognizes a change. I can toggle between two certificate paths since the last is not cached.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/containo/original/2X/b/bd81ebdb578656e76e56ff3cc3eed021d3ba132d.png) [@system](https://community.traefik.io/u/system)\
**Post date:** [March 12, 2022, 12:09pm UTC](https://community.traefik.io/t/manually-update-ssl-certificates/13665/4 "2022-03-12T12:09:35Z")

</div>

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
