Your site runs on a cPanel server, your domain’s DNS is hosted at Cloudflare, and you want a wildcard certificate: one that covers *.example.com, so any subdomain works over HTTPS. AutoSSL will not issue that wildcard while the zone stays at Cloudflare. cPanel’s Let’s Encrypt provider only adds wildcard names when DNS is hosted on the server or its DNS cluster. Manage AutoSSL has no setting that hands it a Cloudflare login. Three routes do work. You can let Cloudflare’s proxy serve the public certificate and put a Cloudflare origin certificate on the server. You can issue a real wildcard yourself with a small ACME client that writes the proof record through Cloudflare’s API. Or you can move DNS to the cPanel server so AutoSSL can do it. Check first whether you need a wildcard at all, because AutoSSL already covers every subdomain that exists in the account.
What you’ll accomplish
- Understand why AutoSSL skips the wildcard when DNS lives at Cloudflare, so you stop retrying it.
- Decide between AutoSSL’s per-name certificate and a wildcard for your actual list of subdomains.
- Set up one route that fits how your records are configured in Cloudflare: proxied, DNS only, or moved off Cloudflare.
- Automate renewal so the certificate never quietly expires.
- Prove with
opensslwhich certificate each hostname is really serving.
Prerequisites
- A cPanel and WHM server where you have root SSH access, and the cPanel username that owns the domain (
exampleuserbelow). - Access to the domain in the Cloudflare dashboard, with permission to create API tokens and edit DNS records.
digandopensslon any machine. Both ship with most Linux distributions and with macOS.- AutoSSL set to the Let’s Encrypt provider, which is the default on new installations. cPanel documents wildcard support for that provider only.
How it works
A certificate authority only signs a name after a check called domain control validation (DCV), which proves you control that name. Let’s Encrypt uses the ACME protocol (the automated request-and-prove exchange its clients speak) and offers two DCV methods that matter here. HTTP-01 asks your server to answer a request for a token file on port 80. DNS-01 asks you to publish a token in a TXT record named _acme-challenge.example.com. Let’s Encrypt states that HTTP-01 cannot be used for wildcard certificates, so every wildcard needs DNS-01.
AutoSSL can only do DNS-01 for zones it can edit, which means zones hosted on the server or on its DNS cluster. cPanel’s documentation for the Let’s Encrypt plugin says so directly: you cannot obtain wildcard certificates through it if you use third-party DNS hosting. When the zone is at Cloudflare, AutoSSL falls back to HTTP-01 and lists each name individually. That still works for ordinary subdomains. It never produces *.example.com.
Which route fits depends on one setting per DNS record in Cloudflare. A proxied record (the orange cloud) sends visitors to Cloudflare, which then connects to you. A DNS-only record (the grey cloud) sends visitors straight to your server. Proxied visitors never see your server’s certificate, so a certificate that only Cloudflare trusts is enough there. DNS-only visitors see your server’s certificate, so it must be publicly trusted.
Decide whether you need a wildcard
AutoSSL issues a SAN certificate, meaning one certificate with a list of Subject Alternative Names, each an exact hostname. For each website on the account, it adds the domain, its www. and mail. names, every subdomain in the account that passes DCV, and service subdomains such as cpanel., webmail., webdisk. and autodiscover.. cPanel’s Guide to SSL lists these and the order AutoSSL adds them in.
| Question | AutoSSL SAN certificate | Wildcard certificate |
|---|---|---|
| Which names are covered | Names that exist in the cPanel account and pass DCV | Any single-level name under the domain, even ones not created yet |
| A new subdomain | Covered after the next AutoSSL run | Covered at once |
Deeper names such as a.b.example.com | Covered if they exist in the account | Not covered; a wildcard matches one level only |
| Size limit | Let’s Encrypt allows at most 100 names per certificate | One wildcard entry replaces many names |
| Validation with DNS at Cloudflare | HTTP-01 works if port 80 reaches the server | Needs DNS-01, so AutoSSL cannot do it |
| If the private key leaks | Only that website’s certificate is exposed | Every site using the wildcard is exposed |
A SAN certificate is the right answer when your subdomains are a known list that you create in cPanel. You need a wildcard when names appear on their own, for example a multi-tenant app that gives each customer customer.example.com through a wildcard subdomain and a * DNS record. You also need one when a website is close to the 100-name limit. For a stable list of subdomains, stop here and fix whichever name AutoSSL is skipping instead. AutoSSL skipped a domain walks through each reason it logs.
Step-by-step
-
Confirm where the zone’s DNS is hosted. Ask for the domain’s nameservers:
dig +short NS example.comExample output:
ivy.ns.cloudflare.com. leo.ns.cloudflare.com.Two
ns.cloudflare.comnames mean Cloudflare hosts the zone and the rest of this article applies. If you see your own server’s nameservers instead, AutoSSL can already issue the wildcard; skip to step 13. -
Check what the live certificate covers today. Replace
blog.example.comwith a name you care about:openssl s_client -connect blog.example.com:443 -servername blog.example.com </dev/null 2>/dev/null | openssl x509 -noout -ext subjectAltNameExample output:
X509v3 Subject Alternative Name: DNS:blog.example.com, DNS:www.blog.example.comIf every name you serve appears in a list like this, AutoSSL is doing its job and a wildcard adds nothing. If a name is missing, or names are created faster than AutoSSL can follow, continue with option A, B or C.
Option A: proxied names (Cloudflare edge certificate plus Origin CA)
Cloudflare’s Universal SSL certificate covers the apex and first-level subdomains for proxied hostnames, so visitors already get a valid public certificate at Cloudflare’s edge. Your job is the hop from Cloudflare to the server.
-
Proxy the web hostnames. In Cloudflare, go to DNS > Records and set the web records to Proxied, including a
*record if you serve names that do not exist yet. Leavemail,cpanel,webmail,webdiskandautodiscoveras DNS only. Mail clients need a direct connection to the server, and AutoSSL keeps covering those names over HTTP-01. -
Create the origin certificate. Go to SSL/TLS > Origin Server > Create Certificate. Choose Generate private key and CSR with Cloudflare with the RSA key type, because Cloudflare marks its ECC root as not for use with Apache on cPanel. The hostname list already contains
example.comand*.example.com. Pick a validity period, select Create, keep the PEM key format, and copy the certificate and private key into two files. Cloudflare shows the private key only once. -
Install it in cPanel. Log in to cPanel as
exampleuser, open SSL/TLS and select Manage SSL sites. In Install an SSL Website, pick the domain from the Domain menu, paste the certificate and private key, and select Install Certificate. Repeat for each subdomain that cPanel lists as its own site, since each one has its own Apache virtual host (the per-site block in Apache’s configuration). -
Switch Cloudflare to Full (strict). Under SSL/TLS > Overview, set the encryption mode to Full (strict). In this mode Cloudflare refuses to connect unless the server presents an unexpired certificate whose names match, issued by a public authority or by Cloudflare’s Origin CA. Check the origin directly, bypassing Cloudflare, with your server’s IP address:
openssl s_client -connect 203.0.113.10:443 -servername shop.example.com </dev/null 2>/dev/null | openssl x509 -noout -issuer -ext subjectAltNameExample output:
issuer=C = US, O = "CloudFlare, Inc.", OU = CloudFlare Origin SSL Certificate Authority, L = San Francisco, ST = California X509v3 Subject Alternative Name: DNS:*.example.com, DNS:example.comIf the issuer is Let’s Encrypt instead, AutoSSL’s certificate is still on that site, so repeat step 5 for that domain. If you have more proxied-only cases, AutoSSL DCV failures behind Cloudflare covers the HTTP-01 side of the same setup.
Option B: DNS-only names (your own Let’s Encrypt wildcard)
Here you run an ACME client outside AutoSSL. It publishes the _acme-challenge TXT record through Cloudflare’s API, collects a publicly trusted wildcard, and installs it into cPanel through UAPI, cPanel’s command-line and HTTP interface for account functions. This example uses acme.sh. Certbot’s certbot-dns-cloudflare plugin does the same job with --dns-cloudflare --dns-cloudflare-credentials, but leaves the cPanel install to you.
-
Point the records at the server. Set the web records, including any
*record, to DNS only in Cloudflare. A public wildcard also works behind the proxy, because Full (strict) accepts publicly trusted certificates, so you can switch proxying on later without changing anything here. -
Create a scoped API token. In Cloudflare, go to My Profile > API Tokens > Create Token. Give it the Zone > DNS > Edit permission and limit it to Specific zone >
example.com. Copy the token, then copy the Zone ID from the domain’s Overview page. -
Install acme.sh as root.
curl https://get.acme.sh | sh -s email=admin@example.comThe last line should read
Install success!. The installer also adds a daily cron job that renews certificates when they are due. -
Issue the wildcard. acme.sh defaults to ZeroSSL, so name Let’s Encrypt explicitly:
export CF_Token="your-scoped-token" export CF_Zone_ID="your-zone-id" ~/.acme.sh/acme.sh --issue --server letsencrypt --dns dns_cf -d example.com -d '*.example.com'Example output (trimmed):
[Sat Oct 24 09:41:07 UTC 2026] Using CA: https://acme-v02.api.letsencrypt.org/directory [Sat Oct 24 09:41:08 UTC 2026] Multi domain='DNS:example.com,DNS:*.example.com' [Sat Oct 24 09:41:11 UTC 2026] Adding record [Sat Oct 24 09:41:12 UTC 2026] Added, OK [Sat Oct 24 09:41:13 UTC 2026] Let's check each DNS record now. Sleeping for 20 seconds first. [Sat Oct 24 09:41:39 UTC 2026] Verification finished, beginning signing. [Sat Oct 24 09:41:44 UTC 2026] Cert success.acme.sh saves the token in
~/.acme.sh/account.conffor renewals, so keep that directory readable by root only. -
Install it on every matching site in the account. The
cpanel_uapideploy hook callsuapi SSL install_sslfor you. With auto mode on, it installs on every site in the account that the certificate matches:export DEPLOY_CPANEL_USER=exampleuser export DEPLOY_CPANEL_AUTO_ENABLED='true' ~/.acme.sh/acme.sh --deploy -d example.com --deploy-hook cpanel_uapiLook for a closing line such as
Successfully deployed certificate to 4 of 4 sites via UAPI. acme.sh remembers the hook and its settings, so each renewal redeploys automatically. Confirm the renewal job exists:crontab -l | grep acme.shExample output:
37 4 * * * "/root/.acme.sh"/acme.sh --cron --home "/root/.acme.sh" > /dev/null -
Decide whether AutoSSL should keep watching these names. AutoSSL does not replace certificates it did not issue. The exception is the WHM option Allow AutoSSL to replace invalid or expiring non-AutoSSL certificates, which replaces them when they are invalid or within three days of expiry. Left on, that option is a safety net if a renewal fails. To stop AutoSSL from handling specific names entirely, exclude them:
uapi --output=jsonpretty --user=exampleuser SSL add_autossl_excluded_domains domains='shop.example.com,app.example.com'The response should contain
"status" : 1. Never excludemail.or the service subdomains that still depend on AutoSSL.
Option C: move DNS to the cPanel server
-
Host the zone on the server or its DNS cluster. Recreate every Cloudflare record in WHM’s DNS Zone Manager, then change the nameservers at your registrar to the server’s own. This ends Cloudflare proxying for the domain. When
dig +short NS example.comreturns your nameservers, run AutoSSL for the account:whmapi1 start_autossl_check_for_one_user username='exampleuser'With DNS local, the Let’s Encrypt provider adds
*.example.comby itself when the site has several subdomains. AutoSSL renews it with nothing else to maintain.
Validate it works
Ask for a hostname that has never existed. Only a wildcard can answer it with a matching certificate. With options B and C, the server only routes unknown names to your site if the account has a wildcard subdomain (*) in cPanel. Without one, Apache answers with the server’s default certificate, so test a real subdomain instead:
openssl s_client -connect example.com:443 -servername "test-$(date +%s).example.com" </dev/null 2>/dev/null | openssl x509 -noout -issuer -enddate -ext subjectAltName
Example output:
issuer=C = US, O = Let's Encrypt, CN = R12
notAfter=Jan 22 08:41:43 2027 GMT
X509v3 Subject Alternative Name:
DNS:*.example.com, DNS:example.com
With option A, this check shows Cloudflare’s edge certificate, so repeat the origin check from step 6 as well. The job is done when the SAN list contains *.example.com, the notAfter date is weeks away, and a browser opens a brand-new subdomain without a warning.
Troubleshooting
- Cloudflare error 526, Invalid SSL certificate. Full (strict) rejected the origin’s certificate. That site’s virtual host is still serving a certificate without the requested name, or one that has expired. Run the step 6 check against the server IP and install the certificate on the site it names.
- acme.sh stops with
invalid domain. The token cannot see the zone. Check that it has Zone > DNS > Edit onexample.comand thatCF_Zone_IDis that zone’s ID, not the account ID. - The deploy hook says
It seems that you are root, please define the target user name. ExportDEPLOY_CPANEL_USERwith the account’s username and run the deploy again. - Browsers warn on a site using the origin certificate. The record was switched to DNS only, or Cloudflare was paused. Origin CA certificates are trusted only by Cloudflare, so turn proxying back on or use option B for that name.
a.b.example.comstill fails. A wildcard covers one level. Add-d '*.b.example.com'in step 10, or let AutoSSL cover that name as an ordinary subdomain.
When this is the wrong approach
If your subdomains are a short, stable list created in cPanel, AutoSSL’s SAN certificate already covers them, so leave it alone. Option B is per-domain upkeep, with a token and a cron job on each server. On a server hosting many client domains, moving DNS to the server (option C) scales better. If you need an organisation-validated or extended-validation certificate, none of these routes help, because Let’s Encrypt and the Cloudflare Origin CA issue domain-validated certificates only. And if one leaked key exposing every subdomain is unacceptable, keep separate certificates per site. Let’s Encrypt wildcard certificates over DNS-01 covers DNS-01 outside cPanel, and cPanel documents the wildcard limits on its Let’s Encrypt plugin page.
If this is the kind of work you’d rather never own again, it’s the daily job of Managed Cloud Ops — book an infrastructure review.