An SSL certificate is a website's electronic ID, which makes the connection between your browser and the server encrypted. A site with a certificate works over HTTPS: its address starts with https:// and there is a padlock icon next to it.
In short
- HTTPS is an encrypted connection to a website; an SSL certificate (formally TLS today) makes it possible.
- Encryption protects data in transit, such as passwords and card numbers, from eavesdropping.
- The padlock does not mean the site is honest - only that the connection is encrypted.
An envelope instead of a postcard
Without encryption, sending data over the Internet is like sending a postcard: anyone who carries it can read it - the café's Wi-Fi operator, your Internet provider, someone on the same network. HTTPS puts that postcard into a sealed envelope that only the recipient, the website's server, can open.
The certificate has a second job too: it confirms you are talking to the server of that domain and not to someone pretending to be it. It is issued by a trusted company or organisation (a certificate authority), and the browser checks everything matches by itself. If it does not, you get a big warning instead of the page.
What exactly is encrypted?
Take the address https://shop.com/search?q=birthday-present-for-mum. On the way, these are encrypted:
- everything after the domain name - the path and parameters, i.e. /search?q=birthday-present-for-mum,
- the page content - text, images, the files you download,
- what you send - passwords, form data, card numbers, messages,
- cookies and headers, including the ones that keep you logged in (more in What are cookies?).
What stays visible:
- the domain name - shop.com. The browser looks it up in DNS and names it when it sets up the connection. Encrypted DNS and newer TLS extensions hide it, but they are not switched on everywhere.
- the server's IP address, which often tells whose site it is.
- when and how much - the time of the connection and the amount of data.
So the café Wi-Fi sees that you visit shop.com, but not what you search for or what you type. One more thing: encryption only covers the journey. The server decrypts everything that reaches it, so the site's owner sees your data. And what happens to it afterwards (how it is stored, who it is shared with) is outside what HTTPS covers.
SSL or TLS?
Formally, the SSL protocol was replaced long ago by the newer and safer TLS. But the name "SSL certificate" stuck and is still used today, hosting offers included. In other words: SSL, TLS, HTTPS - in everyday talk they all mean the same thing, an encrypted connection to a website.
The padlock is not a guarantee of honesty
This is a common misunderstanding. The padlock only says the connection is encrypted and that you are connected to that domain's server. It says nothing about who is behind the site. Phishing sites have certificates too - free certificates are available to anyone. So always look at the address itself as well: "bank-login-verification.com" with a padlock is still not your bank.
Where to get a certificate
Certificates used to cost money and take some work to install. Today most hosts issue a free Let's Encrypt certificate with one click in the control panel and renew it themselves (certificates are short-lived, valid for weeks or months, so automatic renewal is key). Paid certificates still exist and have their uses in companies, but for a blog, a company website or a shop, a free one is perfectly enough.
Once the certificate is on, two steps remain:
- Redirect from http to https, so nobody lands on the unencrypted version. Many panels have a switch for it, and you can also do it with a rule in the .htaccess file (there is an example in the article on mod_rewrite variables).
- Fix resources loaded over http, such as images inserted with an old address. The browser blocks them or marks the page as "not secure" (so-called mixed content).
When it matters to you
- Your site has no HTTPS - browsers mark it as not secure, which scares visitors away and does not help your SEO.
- You are moving your site to a new server - the certificate has to be switched on with the new host (usually after the DNS change).
- You are logging in somewhere on public Wi-Fi - check the padlock and the address before you type your password.