Contact me on Telegram Message

← All articles

SSL Certificate Installed but the Browser Says "Not Secure": Causes and Fixes

The SSL certificate is issued and installed, the hosting panel shows a green checkmark, but the browser still says "Not secure" or even shows a warning page instead of the website. Visitors get scared and leave, and search engines treat such websites worse.

SSL certificate installed but the browser says Not secure

This problem has a few typical causes, and almost all of them are easy to find and fix. Below are specific situations with fixes, and at the end there's a checklist for when the cause is unclear.


How to tell what's wrong

Browsers show different warnings, and they already tell you a lot:

Click the icon to the left of the website address — the browser will show whether the certificate is valid, which domain it was issued for and until when.


The website opens over HTTP

Symptom: at https:// everything is fine, but at http:// the browser says "Not secure".

Cause: the certificate is installed, but the website still opens over the old protocol too. Visitors who follow an old link or type the address without https see the insecure version.

Fix: set up a permanent redirect from HTTP to HTTPS. In Apache, with a rule in .htaccess:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

In Nginx, with a separate server block for port 80:

server {
    listen 80;
    server_name example.com www.example.com;
    return 301 https://example.com$request_uri;
}

💡 Tip: if Nginx sits in front of Apache, as in many control panels, Apache may not know the request came over HTTPS, and the rule will loop. In that case, the condition checks the X-Forwarded-Proto header passed by Nginx instead of %{HTTPS}.


Mixed content

Symptom: the website opens over HTTPS, but some images don't show or parts of the page don't work. Some browsers also show a warning next to the address that the connection is not fully secure.

Cause: the page itself loads over HTTPS, but images, scripts, styles or fonts on it are linked with old http:// addresses. This often happens after switching to HTTPS: old links remain in article texts, theme settings and the database.

Fix: open the page, press F12 and go to the Console tab. The browser will list all such resources marked as Mixed Content. Replace http:// with https:// in them — in the template, website settings or texts. If there are many links and they're stored in the database, use search and replace on the database: WordPress has plugins that do this safely.

⚠️ Important: if a resource is loaded from another website that doesn't work over HTTPS, simply changing the address won't help — it's better to download that file and host it yourself.


The certificate is for the wrong domain

Symptom: a warning with the code NET::ERR_CERT_COMMON_NAME_INVALID (in Firefox, SSL_ERROR_BAD_CERT_DOMAIN).

Cause: the certificate was issued, for example, for example.com, but the website is opened at www.example.com — or the other way around. For the browser these are two different names. Another common case: the server returns someone else's certificate, for example the control panel's certificate, because it couldn't find a website for this domain.

Fix: reissue the certificate for both addresses at once — with and without www, and then set up a redirect from one version to the other. You can check which domains the certificate covers with this command:

echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null | openssl x509 -noout -subject -ext subjectAltName

If instead of your domain the response shows something like parking or the panel's name, see the article "FastPanel Placeholder Page Instead of Your Website".


The certificate has expired

Symptom: a warning with the code NET::ERR_CERT_DATE_INVALID (in Firefox, SEC_ERROR_EXPIRED_CERTIFICATE), even though everything used to work.

Cause: free Let's Encrypt certificates are short-lived — a few months, and the period keeps getting shorter — so they must renew automatically. If renewal breaks, one day the certificate simply runs out. Most often automatic renewal breaks because port 80 is closed, redirects get in the way of the check, or the scheduled job has stopped.

Fix: check the certificate's validity dates with this command:

echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null | openssl x509 -noout -dates

Then reissue the certificate in the panel or with certbot, and be sure to check that renewal works now:

sudo certbot renew --dry-run

If renewal fails, sort out the error with the article "Let's Encrypt Certificate Not Issued".


Incomplete certificate chain

Symptom: the website opens fine in a desktop browser, but some apps, older phones, curl or external services (for example, when sending webhooks) report a certificate error such as NET::ERR_CERT_AUTHORITY_INVALID or "unable to get local issuer certificate".

Cause: the browser checks not only the website's certificate but also the intermediate certificate that signed it. If the server sends only the website's certificate without the intermediate one, some browsers find the missing link on their own, and some don't.

Fix: in the web server settings, specify the file with the full chain. For Let's Encrypt it's fullchain.pem, not cert.pem:

ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;

A convenient way to check the chain is the free SSL Labs service: if there's a problem, it shows the warning Chain issues: Incomplete.


Wrong time

Symptom: a certificate date error appears only for one person or on one device, while the website opens fine for everyone else.

Cause: the date or time on the visitor's device is wrong. The browser compares the certificate's validity period with the device's time and considers a valid certificate either not yet valid or already expired.

Fix: turn on automatic date and time on the device. If everyone gets the error, check the time on the server itself — certificate issuance and renewal depend on it.


If the cause is unclear


Summary

If the website opens but is marked "Not secure", look for HTTP without a redirect and mixed content. If there's a warning instead of the website, check the error code: domain, validity period, chain or time. And after any fix, make sure automatic certificate renewal works, otherwise the problem will come back in a few months.

🔒 If the browser keeps complaining about the certificate, message me — I'll sort it out and set up HTTPS.

Published

← All articles