networking, updated

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)
Specs
RFC 8446, RFC 5246, RFC 6066, RFC 8996
Wireshark filter
tls
Encrypted
yes

Packet structure

TLS record + handshake header9 bytes + variable

Select a field to see what it does.

RFC 8446 / 5246. Every TLS message is wrapped in a 5-byte record header. Handshake messages add a 4-byte header of their own; shown here as in a Client Hello.

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.

VersionStatus
SSL 2.0, 3.0Broken (DROWN, POODLE). Must be disabled.
TLS 1.0, 1.1Deprecated (RFC 8996). Disable.
TLS 1.2Fine with AEAD suites (AES-GCM, ChaCha20) and ECDHE
TLS 1.3Current. Only forward-secret, AEAD suites remain

In Wireshark

FilterShows
tlsAll TLS (on known ports; use “Decode As” for others)
tls.handshake.type == 1Client Hellos
tls.handshake.extensions_server_name contains "example"Connections by server name (SNI)
tls.handshake.type == 11Certificates (TLS 1.2 and older)
tls.record.content_type == 21Alerts (handshake failures, close)
tls.handshake.version < 0x0303Old protocol versions offered or chosen
tls.handshake.ja4 / tls.handshake.ja3Client fingerprints (Wireshark 4.2+)
tcp.port == 443 && !tlsNon-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

References

§ home
~/knubertus/home/
1,1 Top