My certificate check is failing
An incident on a certificate check is headed Certificate check failing, and the line under it names the failure. This page covers the four where Alopex read your certificate and did not like it, followed by the three HTTPS suggestions that Alopex raises as advice only. If Alopex could not connect at all, see Alopex can't reach my site.
The commands below use openssl. Replace <your-host> with the Host on the check and, if the check uses another Port, replace 443.
Certificate expired
What you see
The incident reads Certificate check failing, with the message Expired on <date>. The date is the day the certificate ended. Alopex warns you before this happens, at the days you set in Warn before expiry (days).
Likely causes
- Renewal did not happen. An automatic renewal can stop working, for example when its schedule stops running, a payment lapses, or the renewal cannot prove it controls the host.
- The certificate was renewed, but the server still presents the old one. Many web servers read certificates only when they start or reload.
- Several servers answer for the host, such as a load balancer with more than one node, and one still has the old certificate.
- The check reads a different host or port from the one you renewed.
How to check
Read the dates on the certificate the server presents:
openssl s_client -connect <your-host>:443 -servername <your-host> </dev/null 2>/dev/null | openssl x509 -noout -subject -issuer -dates
The
notAfterline is the end date.Compare it with the Host and Port on the check. Open the check from the domain's Checks tab and choose Edit.
If you run several servers, repeat the command against each one.
How to fix
- Renew the certificate and install it on every server that answers for the host.
- Reload or restart the web server so that it presents the new certificate.
- Select Run now on the check to confirm. The check recovers on its own once a run passes.
Certificate chain invalid
What you see
The incident reads Certificate check failing, with the message The certificate chain is not trusted. Two other messages mean Alopex had nothing to judge: No certificate was presented. and The certificate could not be parsed.
Likely causes
- The server sends its own certificate without the intermediate certificate that links it to the authority. Alopex uses only the certificates the server presents.
- The certificate is self-signed.
- The certificate was issued by a private or internal authority that public software does not trust.
- The certificate was issued by an authority that is no longer trusted.
How to check
Ask for the chain the server sends:
openssl s_client -connect <your-host>:443 -servername <your-host> -showcerts </dev/null 2>/dev/null
Under
Certificate chain, count the certificates. A single certificate for a site issued by a public authority usually means the intermediate is missing.Find the
Verify return codeline near the end. Anything other than0 (ok)names the problem, such asunable to get local issuer certificateorself-signed certificate.
How to fix
- If the intermediate is missing, install the certificate bundle your authority provides, with your certificate first and the intermediates after it.
- If the certificate is self-signed or comes from a private authority, replace it with one from a publicly trusted authority. Alopex has no setting for trusting a private authority.
- Select Run now on the check to confirm.
Certificate does not match host
What you see
The incident reads Certificate check failing, with the message The certificate does not cover <host>. The certificate is valid, but none of the names on it match the Host.
Likely causes
- The certificate was issued for another name, for example
example.combut notwww.example.com. - The Host on the check is not the name you meant.
- A wildcard does not reach far enough.
*.example.comcoverswww.example.combut notexample.comand nota.b.example.com. - The server presents a default certificate for host names it does not recognise.
How to check
List the names on the certificate:
openssl s_client -connect <your-host>:443 -servername <your-host> </dev/null 2>/dev/null | openssl x509 -noout -ext subjectAltName
Compare them with the Host on the check. Alopex reads the names under
subjectAltName. It falls back to the common name only when the certificate has no such list.
How to fix
- Issue a certificate that lists the name, or add the name to the existing one, and install it.
- If the Host is wrong, correct it. The check runs again straight away.
- If you do not serve this host, delete the check.
Weak certificate signature
What you see
The incident reads Certificate check failing, with the message Signed with <algorithm>., for example Signed with RSA-SHA1. Alopex treats signatures made with SHA-1, MD5, MD4, MD2 or SHA-0 as weak. It judges the signature on your server's own certificate only. It does not look at the signatures on intermediate certificates, so a weak intermediate is not reported.
Likely causes
- An old certificate is still installed.
- A certificate was issued from an old internal process that still signs with SHA-1.
How to check
Read the signature algorithm:
openssl s_client -connect <your-host>:443 -servername <your-host> </dev/null 2>/dev/null | openssl x509 -noout -text | grep "Signature Algorithm"
How to fix
- Issue a new certificate signed with SHA-256 or stronger, install it and reload the web server.
- Select Run now on the check to confirm.
Redirect advice
These three findings come from the Check that http:// redirects to https:// option on a certificate check. They appear in the HTTPS card on the domain's Overview, labelled Warning or Suggestion. They are advice only: they never fail the check, change the domain's status or send an alert. Alopex finds them by requesting http://<host>/ with the user agent Alopex/1.0 (+uptime monitor), and it checks http://www.<host>/ too when the host is a registered domain such as example.com. It follows up to 5 redirects. If nothing answers on plain http, it reports nothing.
Each finding has its own wording on the card, and its own section below:
| The card reads | Section |
|---|---|
http://<host> does not redirect to https, a Warning | http:// does not redirect to https:// |
http://<host> redirects temporarily (<status>), a Suggestion to "change the redirect to a permanent one" | http:// redirects temporarily |
No HSTS header on <host>, a Suggestion | No HSTS header |
To see what Alopex sees, request the address and print the headers of every step:
curl -sL -o /dev/null -D - -A "Alopex/1.0 (+uptime monitor)" http://<your-host>/
http:// does not redirect to https://
What you see
A Warning in the HTTPS card reading http://<host> does not redirect to https. After following any redirects, Alopex still ended on an http address.
Likely causes
- No redirect is set up, so the site answers on both
httpandhttps. - The redirect exists for one name only, such as
example.combut notwww.example.com. - A redirect sends visitors on to another
httpaddress.
How to check
Run the curl command above. The last block of headers is the final answer. If its address is still http://, there is no redirect to https. Look at the Location lines to see where each step goes.
How to fix
Add a permanent redirect from http to https on your web server or CDN, for every name you serve. On nginx, for example:
server {
listen 80;
server_name <your-host> www.<your-host>;
return 301 https://$host$request_uri;
}
Visitors who type the address or follow an old link then reach the secure version.
http:// redirects temporarily
What you see
A Suggestion reading http://<host> redirects temporarily (<status>), where the status is a code such as 302. The first redirect from http was neither a 301 nor a 308.
Likely causes
- The redirect rule was written as temporary, or left at a default, such as a
302. - A CDN or hosting panel applies a temporary redirect unless you choose otherwise.
How to check
Run the curl command above and read the first HTTP/ line. The status on it is the one Alopex reports.
How to fix
Change the redirect to a permanent one, 301 or 308. A browser remembers a permanent redirect, and search engines follow it. They may keep the http address for a temporary one.
No HSTS header
What you see
A Suggestion reading No HSTS header on <host>. The final https answer, after any redirects, had no Strict-Transport-Security header. Alopex reports each final host once.
Likely causes
- The header has never been set. Most servers do not send it unless you ask.
- It is set on some paths or hosts only, and the address Alopex ended on is not one of them.
How to check
curl -s -o /dev/null -D - https://<your-host>/ | grep -i strict-transport-security
If nothing prints, the header is missing for that address.
How to fix
Send the header on your https responses. On nginx:
add_header Strict-Transport-Security "max-age=31536000" always;
On Apache, with mod_headers enabled:
Header always set Strict-Transport-Security "max-age=31536000"
Note
A browser that has seen this header refuses to use plain http for the host until max-age runs out, which here is a year. Turn it on once https works on every page you serve.