TLS / SSL
Transport Layer Security encrypts and authenticates application traffic over TCP: HTTPS, mail, LDAPS and VPNs. SSL is its broken predecessor; the name stuck.
- OSI layer
- 5 Session, 6 Presentation
- Carried in
- TCP (DTLS: UDP; QUIC has TLS 1.3 built in)
- Ports
- 443 (HTTPS), 465/587 (SMTP), 636 (LDAPS), 993 (IMAPS), 853 (DoT)
- Wireshark filter
tls- Encrypted
- yes
Packet structure
Select a field to see what it does.
Everything in TLS travels in records. Before the keys are agreed the handshake records are readable; afterwards only the record header is visible.
How it works
TLS 1.3 (one round trip):
sequenceDiagram
participant C as Client
participant S as Server
C->>S: ClientHello (SNI, ALPN, cipher suites, key_share)
S->>C: ServerHello (chosen suite, key_share)
Note over C,S: Keys derived, everything below is encrypted
S->>C: EncryptedExtensions, Certificate, CertificateVerify, Finished
C->>S: Finished
C->>S: Application data
TLS 1.2 needs two round trips: ClientHello → ServerHello, Certificate, ServerKeyExchange, ServerHelloDone → ClientKeyExchange, ChangeCipherSpec, Finished → ChangeCipherSpec, Finished. The server certificate is visible in the capture; in 1.3 it is encrypted.
What stays visible in TLS 1.3: the ClientHello (SNI = server name, ALPN = h2/http/1.1, offered ciphers), the ServerHello, record sizes and timing. Encrypted ClientHello (ECH) hides the SNI too, but is still rare.
| Version | Status |
|---|---|
| SSL 2.0, 3.0 | Broken (DROWN, POODLE). Must be disabled. |
| TLS 1.0, 1.1 | Deprecated (RFC 8996). Disable. |
| TLS 1.2 | Fine with AEAD suites (AES-GCM, ChaCha20) and ECDHE |
| TLS 1.3 | Current. Only forward-secret, AEAD suites remain |
In Wireshark
| Filter | Shows |
|---|---|
tls | All TLS (on known ports; use “Decode As” for others) |
tls.handshake.type == 1 | Client Hellos |
tls.handshake.extensions_server_name contains "example" | Connections by server name (SNI) |
tls.handshake.type == 11 | Certificates (TLS 1.2 and older) |
tls.record.content_type == 21 | Alerts (handshake failures, close) |
tls.handshake.version < 0x0303 | Old protocol versions offered or chosen |
tls.handshake.ja4 / tls.handshake.ja3 | Client fingerprints (Wireshark 4.2+) |
tcp.port == 443 && !tls | Non-TLS traffic on 443 (tunnels, misdetection) |
Decrypting: set SSLKEYLOGFILE for the browser or app, then Preferences › Protocols › TLS › (Pre)-Master-Secret log filename. An RSA private key only works for TLS 1.2 without (EC)DHE.
What normal looks like: ClientHello with SNI, ServerHello, then application data. Alerts mostly at the end (close_notify). Many handshake failures or no SNI to IP addresses can point to scanners or malware.
Security notes
- Old versions and weak suites: SSLv3/TLS 1.0, RC4, 3DES, CBC with MAC-then-encrypt, export ciphers. Check with
testssl.sh,sslscanor the SSL Inspector. - Certificate problems: expired, self-signed, wrong name, weak keys. Clients that do not validate certificates are open to man-in-the-middle.
- SSL stripping: an attacker keeps the victim on plain HTTP. HSTS (with preload) prevents it.
- Interception: TLS inspection proxies and malware install their own root CA. Certificate pinning and CT logs help detect it.
- Fingerprinting: JA3/JA4 hash the ClientHello and identify clients and malware families even when the content is encrypted; JA3S/JA4S do the same for servers.
- Metadata leaks: SNI, certificate (in 1.2), packet sizes and timing reveal a lot about the encrypted traffic.
- Historic bugs worth recognising: Heartbleed (heartbeat records), BEAST, CRIME, POODLE, DROWN, ROBOT.
Versions and related
- SSL was Netscape’s protocol; TLS 1.0 (1999) is its successor. “SSL certificate” and “SSL VPN” still mean TLS.
- DTLS: TLS over UDP. QUIC embeds TLS 1.3.
- STARTTLS: upgrades a plain-text session to TLS (SMTP, IMAP, FTP with AUTH TLS).
- HTTP over TLS is HTTPS. SSH has its own, separate transport encryption.