Overview
TLS (Transport Layer Security) and SSL (Secure Sockets Layer) provide encryption and authentication for secure communication over networks. TLS is the modern standard that replaced SSL, ensuring confidentiality, integrity, and authenticity of transmitted data. It operates at the transport layer and requires certificates issued by a trusted Certificate Authority (CA).
Terminology
| Term | Definition |
|---|---|
| SSL (Secure Sockets Layer) | Legacy encryption protocol developed by Netscape; deprecated in favor of TLS |
| TLS (Transport Layer Security) | Modern encryption standard replacing SSL; standardized by IETF in 1999 |
| Certificate Authority (CA) | Trusted entity that issues and validates digital certificates |
| Digital Certificate | File used to identify a server or client and enable encrypted communication |
| CSR (Certificate Signing Request) | Request generated by a server and submitted to a CA for certificate issuance |
| TLS Handshake | Process of establishing a secure session between client and server |
| Symmetric Encryption | Single shared key used for both encryption and decryption (used after handshake) |
| Asymmetric Encryption | Public/private key pair used during the handshake to exchange the session key |
Core Concepts
History & Versions
| Version | Year | Notes |
|---|---|---|
| SSL 2.0 | 1995 | First public release by Netscape |
| SSL 3.0 | 1996 | Improved but still deprecated |
| TLS 1.0 | 1999 | IETF standardization of SSL |
| TLS 1.2 | 2008 | Widely adopted; still in use |
| TLS 1.3 | 2018 | Major overhaul; faster and more secure |
How TLS Works
TLS uses a combination of asymmetric and symmetric encryption to establish a secure session. The handshake process differs slightly between TLS 1.2 and TLS 1.3.
TLS 1.2 Handshake (2 Round Trips)
- ClientHello — client sends: supported TLS versions, a random value, supported cipher suites (e.g.,
TLS_RSA_WITH_AES_128_CBC_SHA256), and supported compression methods - ServerHello — server responds with: selected TLS version, its own random value, selected cipher suite, and session ID
- Certificate — server sends its X.509 certificate containing domain name, public key, issuer, and expiry
- ServerKeyExchange — (only for DH/ECDH ciphers) server sends Diffie-Hellman parameters; for RSA key exchange this step is skipped
- ServerHelloDone — signals end of server’s portion of the handshake
- ClientKeyExchange — client sends the pre-master secret encrypted with the server’s public key (RSA) or its DH public value; both sides derive the same session keys from the pre-master secret and their random values
- ChangeCipherSpec — both sides signal the switch to encrypted communication
- Finished — both sides send a MAC of all handshake messages to verify integrity; any tampering causes the handshake to fail
TLS 1.3 Handshake (1 Round Trip)
TLS 1.3 eliminates several steps and removes support for weak algorithms (RSA key exchange, MD5/SHA-1, RC4, DES):
- ClientHello — client sends: supported versions, key shares (DH public values for each supported group), cipher suites
- ServerHello — server responds with: selected version, its DH key share; session keys are derived immediately
- Encrypted Extensions + Certificate + CertificateVerify + Finished — all sent in a single encrypted flight
- Client Finished — handshake complete in 1 RTT instead of 2
Cipher Suite Format
A cipher suite specifies all algorithms used during a TLS session:
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
ECDHE— key exchange algorithm (Elliptic Curve Diffie-Hellman Ephemeral — provides forward secrecy)RSA— authentication method (verifies server certificate)AES_256_GCM— symmetric cipher used for the sessionSHA384— MAC algorithm used for integrity
Forward secrecy ciphers (ECDHE, DHE) generate a new session key for each connection — even if the private key is later compromised, past sessions cannot be decrypted.
Certificates
- Digital Certificate — identifies a server/client and enables encryption
- CSR (Certificate Signing Request) — generated by the server admin and submitted to a CA for signing
- Certificates contain: domain name, public key, issuer, expiry date, digital signature
Where TLS Is Used
| Context | Protocol | Port |
|---|---|---|
| Web traffic | HTTPS | 443 |
| Email (sending) | SMTPS | 465/587 |
| Email (receiving) | IMAPS / POP3S | 993 / 995 |
| File transfer | FTPS | 990 |
| VPN tunnels | Various | — |
Related Concepts
Related Techniques
- HTTP Interception
References / Images
- TLS Negotiation
- TLS 1.3 RFC 8446
- SSL historical references and IETF documentation