Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

MrMooky's avatar

Dynamic wildcard SSL certificate

I've been trying and searching all over Google, StackOverflow and the Cloudflare forum, but was not able to solve this issue. Let's say I have an app were users can sign up and create their own page. This page should be accessible from "custom1.domain.com". Another user signs up and creates a page called "mypage" - so the subdomain will be "mypage.domain.com" and so on.

Apparently, this is only possible with a Cloudflare Enterprise plan, which is way too expensive for me. Also, creating a new A record via API is also not a solution, since there can be 1000+ pages.

What other solutions are there so that dynamically(!) created subdomains are automatically available through https? I'm not glued to Cloudflare for this, any reliable, easy to understand service will do it. I looked at AWS Route53 but that seems really complex and also would mean I have to completely move my domain to AWS, not just point there via DNS.

0 likes
8 replies
laracoft's avatar

@mrmooky

Before having my own client, I used https://github.com/skoerfgen/ACMECert

For your wildcard cert, I suggest sending a request for *.domain.com together with domain.com. Makes it easier when you have to support domain.com and its subdomains.

For wildcard certs, your only option is to authenticate via DNS-01. HTTP-01 is not allowed. Each cert is also valid for only 90 days, but with a good client, it's a 1 time setup.

laracoft's avatar

@sinnbeck yes I did because I'm on namesilo

  1. I needed to send in part 1 of DNS-01 for multiple certs
  2. Pause 15 min
  3. Perform part 2 for multiple certs

ACMECert needs to perform #2 for every cert and I could not find a way around it. I also added idiot proof checks such as to ensure key and cert matches as I get careless when sleepy.

A HTTP reload will create chaos when key and cert don't match. :)

Sinnbeck's avatar

@laracoft Ah cool :) If you had made an official package, I would have checked that out ;)

laracoft's avatar

@sinnbeck don't get the wrong impression, it is heavily based on ACMECert. Let me try to package it. It's an artisan command actually.

Sinnbeck's avatar

Its ok. Maybe I will sit down and build some sort of laravel package some day :p

Please or to participate in this conversation.