Automatic wildcard SSL on GoDaddy shared hosting
Free Let's Encrypt wildcard certificates, issued with acme.sh, validated through Cloudflare DNS, and installed into cPanel by one small Python script on a nightly cron job.
Every GoDaddy shared hosting customer hits the same wall sooner or later: SSL certificates that cost money, cover too few names, or need renewing by hand. We run several sites on GoDaddy Web Hosting Deluxe, including m2-design.net, motorate.net, plugsrus.net and aitoolset.app. We wanted every one of them covered, subdomains included, without ever thinking about it again.
This post covers the setup we landed on. Free Let's Encrypt wildcard certificates are issued with acme.sh, validated through Cloudflare DNS, and installed into cPanel by one small Python script on a nightly cron job. The script is open source and should work for any GoDaddy cPanel customer in the same spot.
The setup
Four pieces do the work:
- GoDaddy Web Hosting Deluxe: cPanel shared hosting. You get SSH or cPanel Terminal as your own user, but no root access.
- acme.sh: a shell-based client for requesting certificates. Unlike tools that expect root, it runs entirely from your home folder.
- Let's Encrypt: issues the certificates for free.
- Cloudflare: hosts DNS for all our domains, and proxies most of them.
A wildcard certificate (*.example.com) can only be proven with DNS validation. Let's Encrypt asks you to publish a TXT record, and acme.sh does that through Cloudflare's API. Nothing is written into public_html, so .htaccess redirects and WordPress rewrite rules can't get in the way.
One thing confuses almost everyone. When a site goes through Cloudflare's proxy, there are two connections, and each has its own certificate:
Visitor's browser ──[Cloudflare's certificate]──▶ Cloudflare ──[your Let's Encrypt certificate]──▶ GoDaddy
Visitors only ever see Cloudflare's certificate, which Cloudflare issues and renews itself. Yours secures the hop from Cloudflare to GoDaddy. With Cloudflare's SSL mode set to Full (strict), Cloudflare refuses to connect if your certificate is invalid or expired, so yours still matters even though nobody sees it.
What the script does
renew_certs.py reads a simple JSON file listing your domains. Every night, for each domain, it:
- Checks the live certificate. It connects to each hostname, by default the domain and
www., and reads the certificate being served. With anorigin_ipset, it connects straight to your GoDaddy server, so it checks your certificate rather than Cloudflare's. - Decides whether to renew. If the certificate is invalid, or has fewer days left than your threshold (we use 14), it renews.
- Issues a wildcard certificate. acme.sh requests one certificate covering
example.comand*.example.comfrom Let's Encrypt, using Cloudflare DNS validation. - Installs it in cPanel. acme.sh's
cpanel_uapihook installs the certificate on every cPanel site it covers, subdomain sites included. - Verifies the install. It connects again and confirms each site now serves the new certificate. cPanel can report success when nothing changed, so this step matters.
- Cleans up. It deletes expired certificates from cPanel's certificate storage, never touching one still installed on a site.
A few safeguards keep it from making things worse:
- If a site can't be reached at all, it reports an error but doesn't request a certificate, since a new one wouldn't help and would use up Let's Encrypt's rate limits.
- If acme.sh already holds a fresh certificate, for example after a failed install, it reinstalls that one instead of requesting another.
- A lock file stops two runs from overlapping.
- Any failure makes the script exit with an error, so cron emails you. When everything is fine, it stays silent.
Setting it up
You need acme.sh installed in your GoDaddy account, your DNS on Cloudflare, and Python 3.6 or newer, which GoDaddy's cPanel servers normally have. Setup takes about 20 minutes.
- Create a Cloudflare API token. Go to My Profile → API Tokens → Create Token and start from the "Edit zone DNS" template. Give it Zone → DNS → Edit and Zone → Zone → Read, and set Zone Resources to All zones.
- Upload the files. Put
renew_certs.pyandcerts.jsonin a folder outsidepublic_html, such as~/ssl/, so nobody can download your token from the web. Then lock them down:chmod 700 ~/ssl/renew_certs.py chmod 600 ~/ssl/certs.json mkdir -p ~/logs - Fill in
certs.json. Add your token, your domains, and your server's IP asorigin_ip. cPanel shows the IP as "Shared IP Address" in the right-hand sidebar. A domain entry can be as short as{ "domain": "example.com" }. - Do a dry run. This changes nothing and reports what it would do:
python3 ~/ssl/renew_certs.py --check-only - Renew one domain for real.
It should finish with "verified - now serving the new certificate". Then run it withoutpython3 ~/ssl/renew_certs.py --domain example.com --force -v--domainto do the rest. - Add the cron job. In cPanel → Cron Jobs, set Cron Email to your address and add a daily job:
17 3 * * * /usr/bin/python3 $HOME/ssl/renew_certs.py >/dev/null - Switch Cloudflare to Full (strict) under SSL/TLS → Overview, once your certificates are installed.
If you previously installed acme.sh's own renewal job (acme.sh --cron), remove it with acme.sh --uninstall-cronjob, so the two don't compete.
What tripped us up
None of these are bugs, but each one cost us time, so here they are with the fixes.
| What you see | What it means | What to do |
|---|---|---|
invalid domain and Error adding TXT record to domain: _acme-challenge.example.com |
Your Cloudflare token can't see that domain's zone. One domain working and the rest failing is the giveaway. | Edit the token in Cloudflare and set Zone Resources to "All zones". Also check ~/.acme.sh/account.conf for a leftover CF_Account_ID or CF_Zone_ID from an earlier setup. |
hooks2 ... install_ssl: exit 255 during the install |
A post-install hook GoDaddy adds to cPanel failed. The install itself succeeded. | Ignore it. The script's verification step confirms whether the new certificate is live. |
| Your browser shows a certificate from Google Trust Services, or a different Let's Encrypt one | That's Cloudflare's certificate for visitors, not yours. Cloudflare picks its certificate authority per domain, so your sites may differ. | Check your server directly: echo | openssl s_client -connect YOUR_SERVER_IP:443 -servername example.com 2>/dev/null | openssl x509 -noout -issuer -dates |
Other domains in cPanel listed as example.yourmaindomain.com |
cPanel stores each extra (addon) domain as a site under your main domain's name. | Nothing. The certificate on that site still covers example.com and *.example.com. |
| A new certificate missing from crt.sh | The public certificate transparency log can lag new certificates by several hours. | Check again the next day, or check the server directly. |
Old ec-256 entries in acme.sh --list |
Leftovers from earlier manual setups. They're harmless unless acme.sh --cron ever runs, when they could be renewed and installed over the new ones. |
Remove them: acme.sh --remove -d example.com --ecc, then delete the matching _ecc folder in ~/.acme.sh. |
Why automating this matters now
Certificates are about to get much shorter-lived. Let's Encrypt has announced a staged cut from 90 days to 45:
- 10 February 2027: the default certificate drops to 64 days.
- 16 February 2028: it drops again, to 45 days.
A renewal every few weeks makes doing it by hand in cPanel unworkable. The script needs no changes: it renews based on each certificate's real expiry date, not an assumed 90 days, so it just runs more often. We'd still set renew_days_before to 14 rather than 7. That leaves two weeks to notice a failure email and fix it, which matters because even Let's Encrypt has occasional outages.
Get the script
The script, an example config and full setup notes are on GitHub at mikejohnau/Godaddy_SSL. It's built for GoDaddy Web Hosting Deluxe with Cloudflare DNS. Any cPanel host should work, and so should any DNS provider acme.sh supports, by changing dns_provider in the config.
All of our sites now carry wildcard certificates, and from here on they renew themselves without anyone logging in to cPanel. If you're a GoDaddy customer stuck renewing certificates by hand, we hope it saves you the same hassle.