MENTECHLet’s talkالعربية
Menu

Fix an incomplete or untrusted certificate

Complete the chain.

Your certificate must arrive with the in-between certificate that links it to a public authority. Without it, some phones and apps refuse to connect. A self-signed certificate is refused by everyone.

Before you start

  • Whoever runs your server or hosting can do this. Send them this page.
  • Copy the settings file to another folder, such as your home folder, before you change it. Putting it back is the way to undo this.
  • Download the full chain from the company that issued your certificate. If the certificate is self-signed, get a free one first, using the guide to renewing.

The steps

With Certbot, use fullchain.pem, never cert.pem. With your own files, join them with your certificate first.

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

Then check the settings and reload.

sudo nginx -t && sudo nginx -s reload

If it shows an error, or the site stops, put the saved copy back and restart the server program at once.

Check that it worked

openssl s_client -connect example.com:443 -servername example.com </dev/null 2>/dev/null | grep "Verify return"

The answer should be 0 (ok). 21 means a part is missing. 18 or 20 means the certificate is not from a trusted authority.

To undo it

Put the saved copy of the settings back, then check and reload again.

Common mistakes

  • Joining the files in the wrong order. Your own certificate always comes first.
  • Trusting your own browser. It may have filled the gap from memory, while a new visitor's phone cannot.
Have us fix it for you
CallWhatsAppLet’s talk