SSL certificate: what it is and how to enable it
When you open a site and the browser shows a "Not secure" or "Your connection is not private" warning, the problem is usually the SSL certificate. The certificate turns on https, which means an encrypted connection between the visitor and your site. Below we explain what it is, where the warnings come from and how to remove them.
What an SSL certificate is
An SSL (more precisely TLS) certificate does two things. It encrypts the data sent between the browser and the server, such as passwords or order details. It also confirms that the server really belongs to your domain. The browser checks this automatically, every time.
Where the warning comes from
- The certificate has expired. Certificates have an expiry date. After it passes, the browser stops trusting the site.
- The certificate covers a different name. If it covers only
yourdomain.com, but the site also works aswww.yourdomain.com, the browser shows an error for one of the two versions. - Insecure content on an https page. An image, script or file loaded over plain http triggers a "mixed content" warning. Change the addresses of such resources to https.
- No certificate. The domain has no certificate issued, or it was not installed on the server.
- The clock is wrong. If the clock on the computer is off, a valid certificate may look expired.
How to turn on https on hosting
On hosting, you usually turn on the certificate for a domain in the panel, in the SSL section. You choose the domain and start a Let's Encrypt certificate. After a moment the site works over https. It is also worth turning on a redirect from http to https, so visitors always land on the secure version.
How to turn on https on a VPS
On a VPS running Nginx, you can get a free certificate with the certbot tool:
sudo apt install -y certbot python3-certbot-nginx
sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com
Certbot issues the certificate and adds the configuration itself. Let's Encrypt certificates last 90 days, but they renew automatically. Check it with:
sudo certbot renew --dry-run
How to check that everything works
- Open the site and check the padlock in the address bar. Click it to see who the certificate was issued for and until when it is valid.
- Check both versions of the address: with
wwwand without. - For a more detailed analysis, use the SSL Labs tool, which shows the configuration and any weaknesses.
Checklist
- Certificate issued for the domain and the
wwwversion. - Redirect from http to https works.
- The site does not load resources over http.
- Automatic renewal is on.
Not sure why the site still shows a warning? Write to us at [email protected] and we will check your domain.
The Chmura.tech team