# TLS and Encryption in Transit

> Understand what TLS protects, how the handshake and certificates work, and how to spot weak or broken configurations. Free notes, key concepts, resources and a...

Canonical: https://www.internhack.in/roadmaps/tracks/cybersecurity/tls
Last updated: 2026-11-28

Understand what TLS protects, how the handshake and certificates work, and how to spot weak or broken configurations.

Beginner · about 4 hours · difficulty 3/5

Learn first: [HTTP for Security Work](https://www.internhack.in/roadmaps/tracks/cybersecurity/http)

**TLS** is the protocol behind the padlock in HTTPS. It gives three guarantees: the traffic is **encrypted** (confidentiality), **tamper-evident** (integrity), and the server is **authenticated** by a certificate.

### The handshake in plain words (TLS 1.3)

1. The client says hello with supported cipher suites and a key share.
2. The server replies with its key share and its **certificate**, signed by a certificate authority.
3. Both sides derive the same session keys using an ephemeral key exchange (ECDHE), which gives **forward secrecy**: stealing the server key later does not decrypt old traffic.
4. Encrypted application data flows.

The client validates the certificate chain up to a trusted root, checks the hostname and the validity dates. If any check fails, the browser warns.

### What TLS does not do

It does not make the server trustworthy, hide which domain you visit (SNI is usually visible), or protect data once it reaches the server. Phishing sites have valid certificates too.

### Configuration issues to recognize

- Old protocol versions (SSLv3, TLS 1.0, 1.1) and weak ciphers.
- Expired, self-signed or mismatched certificates.
- Missing **HSTS**, allowing downgrade to plain HTTP.
- Apps that disable certificate verification in code (`verify=False`), which silently enables man-in-the-middle attacks.

### Tools

`openssl s_client -connect example.com:443`, Qualys SSL Labs, and `testssl.sh`.

Good enough: you can inspect a site's certificate chain and TLS version, and explain why an app skipping certificate verification is a critical bug.

## Key concepts

- **TLS guarantees**
- **TLS 1.3 handshake**
- **Certificate validation**
- **Forward secrecy**
- **HSTS and downgrade attacks**
- **openssl s_client and SSL Labs**
- **Mutual TLS (mTLS)**

## Mini project

Scan three websites with SSL Labs and openssl, then write a comparison of their protocol versions, certificate chains and HSTS settings.

## Check yourself

Why does a valid HTTPS certificate not prove a website is safe?

## Free resources

- [The Illustrated TLS 1.3 Connection](https://tls13.xargs.org/) (xargs.org)
- [Qualys SSL Labs Server Test](https://www.ssllabs.com/ssltest/) (Qualys)
- [Mozilla SSL Configuration Generator](https://ssl-config.mozilla.org/) (Mozilla)

Previous: [HTTP for Security Work](https://www.internhack.in/roadmaps/tracks/cybersecurity/http) · Next: [Packet Analysis with Wireshark](https://www.internhack.in/roadmaps/tracks/cybersecurity/wireshark)

## More in Networking for Security

- [How the Internet and TCP/IP Work](https://www.internhack.in/roadmaps/tracks/cybersecurity/internet-basics)
- [Subnetting, Ports and Common Services](https://www.internhack.in/roadmaps/tracks/cybersecurity/subnetting-ports)
- [DNS and How It Gets Abused](https://www.internhack.in/roadmaps/tracks/cybersecurity/dns)
- [HTTP for Security Work](https://www.internhack.in/roadmaps/tracks/cybersecurity/http)
- [TLS and Encryption in Transit](https://www.internhack.in/roadmaps/tracks/cybersecurity/tls)
- [Packet Analysis with Wireshark](https://www.internhack.in/roadmaps/tracks/cybersecurity/wireshark)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [Cybersecurity Roadmap](https://www.internhack.in/roadmaps/tracks/cybersecurity)
