Fix SSL Certificate Errors on a Subdomain in Hostinger

by Fahim

You set up a new subdomain like app.yourdomain.com or staging.yourdomain.com in Hostinger, hit Install SSL, and your browser immediately throws NET::ERR_CERT_COMMON_NAME_INVALID or SSL_ERROR_BAD_CERT_DOMAIN. I have run into this roadblock dozens of times. Let’s trace why the certificate failed to issue, check your DNS records from the terminal, clear out bad CAA records, and force hPanel to spit out a working Let’s Encrypt certificate.

Hostinger bundles free Let’s Encrypt SSL, but subdomains do not inherit your apex domain’s certificate unless you set up a wildcard or generate a dedicated SAN (Subject Alternative Name). If your domain uses an external DNS provider, or if hPanel’s internal provisioning script hits a snag during the ACME challenge, your subdomain gets stuck in HTTPS limbo. Here is how to fix it.

Terminal screen showing OpenSSL handshake verification for a subdomain certificate on Hostinger
Terminal screen showing OpenSSL handshake verification for a subdomain certificate on Hostinger

1. Diagnose the Exact Handshake Failure with OpenSSL and cURL

Never trust your browser cache when debugging SSL errors. Chrome and Firefox cache intermediate certificates aggressively and bury the real handshake failure behind vague warning screens. Drop into your terminal and test the subdomain directly with OpenSSL.

Run this command to inspect the certificate chain your server returns on port 443:

openssl s_client -connect staging.example.com:443 -servername staging.example.com

Pay attention to two fields in the output: CN = (Common Name) and subjectAltName. If the Common Name only lists your root domain (example.com) without an entry for your subdomain, Hostinger’s LiteSpeed/Nginx web server is serving the fallback virtual host certificate because it never generated one for your subdomain.

Next, fire off a verbose cURL request to pinpoint where the handshake drops:

curl -Iv https://staging.example.com

If you see curl: (60) SSL certificate problem: self-signed certificate or SSL certificate verify result: unable to get local issuer certificate (20), hPanel created a dummy self-signed cert while queuing Let’s Encrypt, but the background cron job failed to replace it.

2. Verify Subdomain DNS Resolution and IP Matching

Let’s Encrypt validates domain ownership using an HTTP-01 challenge. Hostinger drops a temporary token into the /.well-known/acme-challenge/ directory on your document root. If your subdomain’s DNS does not point straight to your Hostinger server’s IP, the Let’s Encrypt validation server gets a 404 or a timeout, and the issuance script fails quietly.

Check where your subdomain currently resolves using dig or host:

dig +short staging.example.com A

Compare that output with your Hostinger server IP (find it in hPanel under Websites > Dashboard > Plan Details). If the IPs do not match, Hostinger cannot complete the automated validation challenge.

This trip-up happens constantly when managing DNS through another registrar. If you use Namecheap for DNS while hosting on Hostinger, check out our guide on how to point a Namecheap subdomain to Hostinger without touching the main site to ensure your A record or CNAME routes properly.

Prefer a wildcard setup instead of creating separate DNS records for every staging build? See our guide on setting up wildcard subdomain DNS in Namecheap.

3. Inspect CAA Records That Block Let’s Encrypt

Certification Authority Authorization (CAA) records define which certificate authorities are allowed to issue certs for your domain. If your apex domain has a CAA record that only permits DigiCert or Sectigo, Let’s Encrypt is legally barred from issuing a certificate for your subdomain.

Check your domain’s CAA records from your terminal:

dig CAA example.com +short

If the output shows entries like 0 issue "sectigo.com" but nothing for Let’s Encrypt, you need to add an entry in your DNS zone editor:

example.com. IN CAA 0 issue "letsencrypt.org"

Under the official Let’s Encrypt CAA specification, subdomains inherit CAA records from the parent domain unless you override them with a dedicated record on the subdomain. Once updated, give it 5 to 10 minutes for DNS caching to clear before re-triggering the installation in Hostinger.

4. Force Reinstallation of the SSL Certificate in hPanel

When an SSL installation trips up in hPanel, the status often stays stuck on “Failed” or “Installing” forever. The panel will not retry on its own until you clear the failed task.

  1. Log in to Hostinger hPanel.
  2. Go to Websites > Manage for your parent domain.
  3. In the left sidebar, click Security > SSL.
  4. Find your subdomain in the list. If it says Failed or Error, click the three dots (...) on the right and select Uninstall.
  5. Once cleared, click the Install SSL button at the top right.
  6. Pick your subdomain from the dropdown and hit Install.

Hostinger fires off an automated background task via the Hostinger SSL provisioning system. Leave the screen alone for about 60 to 90 seconds. Once the badge turns green and reads Active, verify it in your terminal.

5. Fix .htaccess Rules Blocking the ACME HTTP-01 Challenge

If your subdomain shares the parent website’s directory structure, or if you dropped custom rewrite rules into your subdomain’s .htaccess file, you might be intercepting Hostinger’s challenge requests. When Let’s Encrypt reaches out to http://staging.example.com/.well-known/acme-challenge/token, an aggressive rewrite rule can redirect it to HTTPS prematurely, throw a 403, or trigger basic auth.

Open your subdomain’s .htaccess file (typically in domains/example.com/public_html/staging/.htaccess or directly in public_html/.htaccess) and add an exception above your main rewrite rules:


RewriteEngine On # Exclude ACME challenge directory from all HTTPS rewrites
RewriteRule ^.well-known/acme-challenge/ - [L] # Standard HTTPS redirection
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

This rule tells the server to bypass all internal rewrites whenever an incoming request hits the .well-known path, letting the ACME bot fetch the challenge token with a clean 200 OK.

If your subdomain runs WordPress and throws mixed-content warnings after fixing the SSL, follow our guide on how to fix WordPress mixed content warnings on Hostinger after SSL.

6. Address Cloudflare Edge Proxy and SSL Encryption Modes

If your domain routes through Cloudflare’s orange-cloud proxy, Hostinger will often fail to validate or renew SSL certificates. Cloudflare terminates SSL at the edge, which can mangle the HTTP-01 ACME challenge requests before they hit your Hostinger origin.

Two main issues bite developers here:

  • Cloudflare SSL Mode set to Flexible: Cloudflare talks to Hostinger over plain HTTP (port 80). If Hostinger has “Force HTTPS” enabled, you end up in an infinite redirect loop (ERR_TOO_MANY_REDIRECTS). Set your Cloudflare SSL mode to Full (Strict).
  • Edge Proxy Active During Initial Issuance: Let’s Encrypt cannot verify the origin IP if Cloudflare security layers (like Bot Fight Mode) challenge the ACME crawler.

Here is how to bypass this temporarily:

  1. In your Cloudflare dashboard, head to DNS > Records.
  2. Find the A or CNAME record for your subdomain and flip the Proxy status to DNS only (gray cloud).
  3. Go back to Hostinger hPanel and hit Reinstall SSL for the subdomain.
  4. Once hPanel confirms the certificate is active, flip the Cloudflare proxy back to orange.

Check out the OpenSSL s_client documentation to query your server’s direct IP with SNI if you need to test without Cloudflare in the way.

7. Resolve WordPress Subdomain Virtual Host Misconfigurations

Hostinger lets you create subdomains either as a directory inside your main site’s public_html or as a separate isolated web folder. If you spun up a staging site manually or migrated an existing database, your internal WordPress URLs might still be hardcoded to plain HTTP.

If you have SSH access enabled on your Hostinger plan, check your current site URLs with WP-CLI:

# Navigate to your subdomain directory
cd ~/domains/example.com/public_html/staging # Check the current configured URLs
wp option get siteurl
wp option get home

If they come back with http://, update them to HTTPS right away:

wp option update siteurl 'https://staging.example.com'
wp option update home 'https://staging.example.com'

Always flush your object cache right after so you do not get stuck serving stale redirects:

wp cache flush

Frequently Asked Questions

Why does my main domain have a valid SSL, but my subdomain does not?

Hostinger’s standard automated certificate covers only your apex domain and the www prefix (like example.com and www.example.com). It does not include a wildcard (*.example.com) by default. Every subdomain you create requires its own dedicated certificate or needs to be added as a Subject Alternative Name (SAN).

How long does an SSL certificate take to activate on Hostinger?

If your DNS records point straight to Hostinger’s servers and your records have propagated, certificate issuance takes between 1 and 3 minutes. If you changed your DNS recently, you may need to wait for local DNS caches to clear before Let’s Encrypt can validate the challenge.

Can I install a custom SSL certificate for my subdomain in hPanel?

Yes. If you bought a commercial certificate or generated one locally using certbot, head to Security > SSL > Custom SSL in hPanel. Choose your subdomain from the dropdown, paste your CRT, Private Key (KEY), and CA Bundle (CABUNDLE), and click Install.

Why do I see ERR_SSL_VERSION_OR_CIPHER_MISMATCH on my subdomain?

This means your browser and the web server failed to negotiate a compatible TLS protocol or cipher suite. On Hostinger, this almost always points to a virtual host with no certificate bound to it at all, or a browser requesting HTTPS from a port where only an unencrypted HTTP listener is running.

Next Steps for Your Subdomain

Now that your subdomain runs on a clean TLS handshake and serves a valid certificate, make sure it is protected from search engines and unauthorized scrapers. If this subdomain is a development or staging environment, read our guide on how to password protect a WordPress staging site with .htaccess to lock it down behind HTTP Basic Authentication.

all_in_one_marketing_tool