TLS, Certificates and HTTPS
Chapters and transcript
TLS, Certificates and HTTPS You are on café Wi-Fi, and you open your email over HTTPS. Someone on the same network captures your traffic, but sees only ciphertext. Your browser shows a padlock. Every lesson in this path comes together right here. In this lesson, you will see how HTTPS works, what a certificate really proves, and how end-to-end encryption goes one step further.
What TLS does TLS, Transport Layer Security, is the protocol that protects data travelling between two computers. HTTPS is normal web traffic sent inside TLS. It gives all three goals. Confidentiality: nobody on the network can read the data. Integrity: changes are detected. Authenticity: your browser checks it is talking to the real server. And use TLS 1.2 and 1.3. SSL, TLS 1.0 and 1.1 are outdated and should be turned off.
The handshake Before any page is sent, browser and server perform a handshake. Here is TLS 1.3. First, the client hello. Your browser lists the methods it supports, and sends its part of an ECDHE key exchange. Then the server hello. The server picks the methods and sends its own part. Both sides can now calculate the same shared secret, like the paint example. Next, the server sends its certificate.
The handshake Now the server signs the handshake with its private key. Your browser checks it with the public key from the certificate. Both sides send finished messages, built from hashes of the handshake, to confirm nothing was tampered with. From now on, all data uses fast symmetric authenticated encryption, such as AES-GCM. Key exchange, signatures, hashes and symmetric encryption: every lesson, working together.
Certificates How does your browser know the key belongs to the real example dot com? A certificate links a public key to a name. It contains the domain names it is valid for, the server's public key, the issuer, the validity dates, and the issuer's digital signature over all of it. The issuer is a certificate authority, trusted to check that the requester controls the domain.
Chain of trust Certificates form a chain of trust. A root CA sits in your trust store, the list built into your system and browser. The root signs an intermediate CA certificate. The intermediate signs the certificate for www dot example dot com. Your browser checks each signature up the chain, the dates, and that the name matches. If any check fails, you see a warning.
Chain of trust Try it in your browser. Open any HTTPS website, click the padlock or site information icon, and open the certificate details. Find the domain name, the issuer, the expiry date, and the chain up to the root CA. Most website certificates only prove control of the domain. Free, automated authorities such as Let's Encrypt have made HTTPS available to every website.
The padlock So what does the padlock mean? Your connection to this domain is encrypted, and the server proved it holds a valid certificate for this domain. What does it not mean? It does not mean the website is honest, that the domain belongs to the company you think, or that the site is free from malware.
The padlock Look at this login page. It has a padlock, and it looks like ChaiCorp. But read the address: chaicorp dash login dot example. Criminals can easily get a valid certificate for their own lookalike domain. A phishing page with a padlock is still a phishing page. Always check the domain name itself, not only the padlock.
Certificate warnings When a certificate check fails, your browser shows a full-page warning. Common causes: an expired certificate, which the owner forgot to renew. A name mismatch, where the certificate is for a different domain. Or an untrusted issuer, or a self-signed certificate, not signed by a CA in your trust store.
Certificate warnings On public Wi-Fi, a sudden warning on your bank can be a sign of a man-in-the-middle attack. The attacker presents his own certificate. Your browser shows a warning. Clicking continue anyway can hand your data to him. Sites that use HSTS will not let you click past at all. And developers, never turn off certificate checks to fix an error.
End-to-end encryption TLS protects data between your device and the server, and the server can read it. End-to-end encryption goes further. Sana's phone encrypts the message. The server passes only ciphertext, and cannot read it. Only Omar's phone decrypts it. WhatsApp and Signal do this by default. In Telegram, it is only used in special secret chats.
End-to-end encryption End-to-end encryption has limits. Metadata, such as who you talk to and when, may still be visible. Cloud backups may not be encrypted unless you turn that option on. Your device is an end, so spyware or an unlocked screen defeats it. And scammers use it too. You can compare a security code with a contact to confirm no one is in the middle.
Quick check Quick check. You are on café Wi-Fi, and your bank's website suddenly shows a full-page certificate warning. What should you do? Choose one.
Key takeaways Let us put it together. Read the domain name before typing a password. The padlock alone is not enough. Never click past certificate warnings on banking, email or work sites. Turn on encrypted backups, and verify security codes with important contacts. And website owners, use HTTPS everywhere, turn off old TLS versions, and renew certificates automatically. You have now finished the cryptography path.
Every lesson in this path comes together in one place: the padlock in your browser. In this lesson you will see how HTTPS uses symmetric encryption, public keys, signatures and hashes together, what a certificate really proves, and how end-to-end encryption in apps like WhatsApp goes one step further.
What TLS does
TLS (Transport Layer Security) is the protocol that protects data travelling between two computers. HTTPS is simply normal web traffic (HTTP) sent inside a TLS connection. TLS is also used by email servers, banking apps, VPNs and many mobile apps.
TLS gives all three goals from the first lesson:
- Confidentiality: nobody on the network, such as someone on the same café Wi-Fi, can read the data.
- Integrity: nobody can change the data on the way without the change being detected.
- Authenticity: your browser can check that it is talking to the real server for that domain name, not an impostor.
You may still hear the old name SSL. SSL and the early versions TLS 1.0 and TLS 1.1 are outdated and should be turned off. Today, servers should use TLS 1.2 and TLS 1.3. TLS 1.3 is faster and removes many older, weaker options.
The HTTPS handshake, step by step
Before any web page is sent, the browser and the server perform a handshake to set up the secure connection. In TLS 1.3, it looks like this at a high level:
- Client hello. Your browser says hello, lists the encryption methods it supports, and sends its part of a key exchange (an ephemeral ECDHE public value).
- Server hello. The server picks the methods to use and sends its own key exchange part. Both sides can now calculate the same shared secret, exactly like the Diffie-Hellman paint example.
- Certificate. The server sends its certificate, which contains its public key and its domain name.
- Proof of the private key. The server signs the handshake with its private key. Your browser checks this signature with the public key from the certificate. This proves the server really owns that certificate.
- Finished. Both sides confirm that the handshake was not tampered with, using values calculated from hashes of all the handshake messages.
- Encrypted data. From now on, all data is protected with fast symmetric authenticated encryption, such as AES-GCM or ChaCha20-Poly1305, using session keys made from the shared secret.
Notice how each lesson in this path appears: key exchange and signatures from public-key cryptography, hashing for integrity, and symmetric encryption for the actual data. Because the key exchange is ephemeral, TLS 1.3 also gives forward secrecy.
Certificates and certificate authorities
The handshake proves the server owns a private key. But how does your browser know that the key belongs to the real example.com? This is the trust problem from the previous lesson, and certificates solve it.
A certificate is a digital document that links a public key to a name. It contains:
- The domain name or names it is valid for
- The server's public key
- The issuer, the organisation that created the certificate
- Validity dates, meaning when it starts and when it expires
- The issuer's digital signature over all of the above
The issuer is a certificate authority (CA): an organisation trusted to check that the requester really controls the domain before signing a certificate. Your operating system and browser come with a built-in list of trusted root CAs, called the trust store.
Certificates form a chain of trust:
Root CA (in your trust store)
└── signs Intermediate CA certificate
└── signs www.example.com certificate
Your browser checks each signature up the chain until it reaches a root it already trusts. It also checks that the dates are valid and that the name matches the website address. If any check fails, you see a warning.
Most website certificates only prove control of the domain. Free, automated authorities such as Let's Encrypt have made HTTPS available to every website, which is a good thing for privacy.
What the padlock does and does not mean
The padlock means:
- Your connection to this domain is encrypted.
- The server proved it holds a valid certificate for this domain.
The padlock does not mean:
- That the website is honest or safe
- That the domain belongs to the company you think it does
- That the site is free from malware
Criminals can easily get a valid certificate for their own domain, such as chaicorp-login.example or a misspelled bank name. A phishing page with a padlock is still a phishing page. Always check the domain name itself, not only the padlock.
Certificate warnings
When a certificate check fails, your browser shows a full-page warning. Common reasons:
| Warning cause | What it means |
|---|---|
| Expired certificate | The site owner forgot to renew it. Usually careless, sometimes something worse. |
| Name mismatch | The certificate is for a different domain than the one you visited. |
| Untrusted issuer or self-signed | The certificate was not signed by a CA in your trust store. |
On public Wi-Fi, a sudden warning on a well-known site such as your bank can be a sign that someone is trying a man-in-the-middle attack. Clicking "continue anyway" can hand your data to the attacker. Some sites use a setting called HSTS, which tells the browser to always use HTTPS for that site; on those sites the browser will not let you click past the warning at all.
On company devices, you may see that traffic is inspected by a security system that uses the company's own root certificate. This is done on purpose by IT and installed on managed devices. It is not something to copy on personal devices.
For developers: never turn off certificate checking in an app to "fix" an error. That removes the authenticity part of TLS completely.
End-to-end encryption in messaging apps
TLS protects data between your device and the server. The server itself decrypts the data and can read it. That is normal for websites, but for private conversations you may want more.
End-to-end encryption (E2EE) means messages are encrypted on the sender's device and can only be decrypted on the recipient's device. The company's servers only pass on ciphertext. WhatsApp and Signal use end-to-end encryption for chats and calls by default. Not every app does this: in Telegram, for example, end-to-end encryption is only used in special "secret chats", not in normal chats.
Important limits of E2EE:
- Metadata such as who you talk to, when and how often may still be visible to the service.
- Backups stored in the cloud may not be end-to-end encrypted unless you turn that option on. WhatsApp offers an optional encrypted backup setting.
- Your device is an end. If a phone has spyware, or someone sees your unlocked screen, E2EE cannot help.
- Scammers use E2EE too. Encryption protects the conversation, not the honesty of the person you are talking to.
Apps let you compare a security code or safety number with your contact, in person or by call, to confirm that no one is sitting in the middle.
What to do
- Read the domain name before typing a password or card number. The padlock alone is not enough.
- Never click past certificate warnings on banking, email or work sites. Close the page and try again later from a trusted network.
- Turn on encrypted backups in your messaging apps, and verify security codes with important contacts.
- Website owners: use HTTPS everywhere, turn off old TLS versions, and set up automatic certificate renewal so certificates never expire by surprise.
Try it yourself. In your browser, open any HTTPS website, click the padlock or site information icon next to the address, and open the certificate details. Find the domain name, the issuer, the expiry date and the chain up to the root CA. If you have OpenSSL installed, you can see the same information from the command line:
openssl s_client -connect example.com:443 -servername example.com
Press Ctrl+C to exit. Look for the certificate chain and the TLS version in the output.
HANDS-ON LAB
Which Certificate Failed?
Staff see a browser warning on one ChaiCorp site. Read the certificate check and find which one.
Check your understanding
Answer every question correctly to complete this lesson. If you miss one, try the quiz again.
1. During an HTTPS connection, which type of encryption protects the actual web pages and form data after the handshake?
2. A website at chaicorp-login.example shows a padlock in the browser. What does the padlock prove?
3. In a messaging app with end-to-end encryption, who can read the content of your messages?
Locked: answer every quiz question above correctly to complete this lesson.
Spotted a mistake or something unclear? Report a mistake