# Multiple default certs

**URL:** <https://community.traefik.io/t/multiple-default-certs/20344>\
**Category:** Traefik v2\
**Tags:** file\
**Created:** [November 2, 2023, 7:58am UTC](https://community.traefik.io/t/multiple-default-certs/20344 "2023-11-02T07:58:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Night\_Hunter](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/night_hunter/32/7788_2.png) [@Night\_Hunter](https://community.traefik.io/u/Night_Hunter)\
**Post date:** [November 2, 2023, 7:58am UTC](https://community.traefik.io/t/multiple-default-certs/20344/1 "2023-11-02T07:58:43Z")

</div>

is there a way to do something like this.  
so i can have multiple default certs

```yml
tls:
  stores:
    default:
      defaultGeneratedCert:
        certResolver: cloudflare
        domains:
          - main: example.com
            sans:
              - "*.example.com"
          - main: test.example.com
            sans:
              - "*.test.example.com"

```

---

<div class="post-metadata">

**Author:** ![bluepuma77](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bluepuma77](https://community.traefik.io/u/bluepuma77)\
**Post date:** [November 2, 2023, 8:30am UTC](https://community.traefik.io/t/multiple-default-certs/20344/2 "2023-11-02T08:30:30Z")

</div>

No, not according to [doc](https://doc.traefik.io/traefik/https/tls/#default-certificate):

> Traefik can use **a default certificate** for connections without a SNI, or without a matching domain. This default certificate should be defined in a TLS store

If you have multiple, how should Traefik decide which one to use in case of no match?

---

<div class="post-metadata">

**Author:** ![Night\_Hunter](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/night_hunter/32/7788_2.png) [@Night\_Hunter](https://community.traefik.io/u/Night_Hunter)\
**Post date:** [November 2, 2023, 9:46am UTC](https://community.traefik.io/t/multiple-default-certs/20344/3 "2023-11-02T09:46:00Z")

</div>

i guess default isnt what i want. what i want is somthing that fetchs the certs so all i have to add on a container is `traefik.http.routers.panel.tls: true`

---

<div class="post-metadata">

**Author:** ![bluepuma77](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bluepuma77](https://community.traefik.io/u/bluepuma77)\
**Post date:** [November 2, 2023, 10:21am UTC](https://community.traefik.io/t/multiple-default-certs/20344/4 "2023-11-02T10:21:29Z")

</div>

Declare cert with main/sans domain on the entrypoint ([doc](https://doc.traefik.io/traefik/routing/entrypoints/#tls)), assign the certresolver to the entrypoint.

---

<div class="post-metadata">

**Author:** ![Night\_Hunter](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/night_hunter/32/7788_2.png) [@Night\_Hunter](https://community.traefik.io/u/Night_Hunter)\
**Post date:** [November 2, 2023, 10:39am UTC](https://community.traefik.io/t/multiple-default-certs/20344/5 "2023-11-02T10:39:34Z")

</div>

oh thanks i dont know how i missed that

---

<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:** [November 5, 2023, 10:40am UTC](https://community.traefik.io/t/multiple-default-certs/20344/6 "2023-11-05T10:40:19Z")

</div>

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