knowledge

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

TermDefinition
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 CertificateFile 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 HandshakeProcess of establishing a secure session between client and server
Symmetric EncryptionSingle shared key used for both encryption and decryption (used after handshake)
Asymmetric EncryptionPublic/private key pair used during the handshake to exchange the session key

Core Concepts

History & Versions

VersionYearNotes
SSL 2.01995First public release by Netscape
SSL 3.01996Improved but still deprecated
TLS 1.01999IETF standardization of SSL
TLS 1.22008Widely adopted; still in use
TLS 1.32018Major 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)

  1. 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
  2. ServerHello — server responds with: selected TLS version, its own random value, selected cipher suite, and session ID
  3. Certificate — server sends its X.509 certificate containing domain name, public key, issuer, and expiry
  4. ServerKeyExchange — (only for DH/ECDH ciphers) server sends Diffie-Hellman parameters; for RSA key exchange this step is skipped
  5. ServerHelloDone — signals end of server’s portion of the handshake
  6. 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
  7. ChangeCipherSpec — both sides signal the switch to encrypted communication
  8. 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):

  1. ClientHello — client sends: supported versions, key shares (DH public values for each supported group), cipher suites
  2. ServerHello — server responds with: selected version, its DH key share; session keys are derived immediately
  3. Encrypted Extensions + Certificate + CertificateVerify + Finished — all sent in a single encrypted flight
  4. 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 session
  • SHA384 — 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

ContextProtocolPort
Web trafficHTTPS443
Email (sending)SMTPS465/587
Email (receiving)IMAPS / POP3S993 / 995
File transferFTPS990
VPN tunnelsVarious

  • HTTP Interception

References / Images

  • TLS Negotiation
  • TLS 1.3 RFC 8446
  • SSL historical references and IETF documentation