Search code examples
lets-encrypttraefik

Configure wildcard certificates with traefik and let's encrypt?


Starting with traefik 1.6.0 it should be possible to get wildcard certificates from Let's Encrypt for a domain, using the dns challenge.

Using the example below, what do you need to change to get wildcard certificates?

# Enable ACME (Let's Encrypt): automatic SSL
[acme]
email = "[email protected]"
storage = "C:/etc/ssl/lets-encrypt.json"
entryPoint = "https"
acmeLogging = true
  [acme.dnsChallenge]
  provider = "cloudflare"

  [[acme.domains]]
    main = "domain.com"
    sans = ["www.domain.com","sub.domain.com"]

Solution

  • The Change what you are looking for is implemented ~2-3 days ago in traefik and the documentation could be found @traefik.io v1.6 acme

    from what you shared in the question, I see you are using CloudFare as provider and from the very same configuration link above, below configuration properties are to be included as well :--

    1. CLOUDFLARE_EMAIL
    2. CLOUDFLARE_API_KEY - The Cloudflare Global API Key needs to be used and not the Origin CA Key

    Add those config properties and try to generate WildCard?

    Important points to consider:

    Wildcard domains Wildcard domain has to be defined as a main domain with no SANs (alternative domains). All domains must have A/AAAA records pointing to Træfik.

    WARNING Note that Let's Encrypt has rate limiting.