Transport Layer Security (TLS) is a family of cryptographic protocols for protecting communication between applications across a network. It combines authentication, key establishment, and encryption to provide a channel in which an observer cannot ordinarily read application data or modify it without detection. Its best-known use is HTTPS, which secures communication between websites and web browsers, but it also protects messaging, directory services, database connections, and many other network applications.
TLS is standardized by the Internet Engineering Task Force (IETF). It developed from Secure Sockets Layer (SSL), a protocol introduced by Netscape in the 1990s. Although “SSL” remains common in product names and informal expressions such as “SSL certificate,” SSL and TLS are distinct protocol versions, and obsolete SSL versions are no longer suitable for secure communication. TLS 1.3, specified in RFC 8446 in 2018, substantially simplified the protocol and removed many older cryptographic mechanisms.
The security of a TLS connection depends on more than encryption alone. It also depends on identifying the intended peer, protecting private keys, implementing the protocol correctly, and integrating it with the application’s security model. TLS protects data between its cryptographic endpoints; it does not by itself establish that a service is honest, protect a compromised endpoint, or conceal every feature of network activity.
Historical development and standardization
Netscape developed SSL to make commercial transactions and other sensitive exchanges practical on the early World Wide Web. SSL 2.0 appeared in 1995, but weaknesses in its handshake and integrity protection soon motivated a replacement. SSL 3.0, released in 1996, introduced a substantially revised design. The IETF subsequently standardized TLS 1.0 in January 1999 as RFC 2246, edited by Tim Dierks and Christopher Allen. TLS 1.0 was closely related to SSL 3.0, but the two were not interchangeable.
Successive versions changed both cryptographic details and the way security parameters were negotiated. TLS 1.1, published in RFC 4346 in April 2006, introduced explicit initialization vectors for cipher-block-chaining encryption, addressing problems associated with predictable chaining values. TLS 1.2, published in RFC 5246 in August 2008, made signature and hash algorithm selection more flexible and supported authenticated-encryption cipher suites. It became an important transitional version because it could support modern cryptography while retaining compatibility with a broad range of earlier mechanisms.
TLS 1.3 was published in August 2018 after an extended design process involving implementers, cryptographers, and operators. It removed static RSA key transport, static Diffie–Hellman key exchange, older symmetric ciphers, compression, and renegotiation. It also reduced the number of network round trips needed for a normal handshake and encrypted more handshake information. Unlike an incremental cipher update, TLS 1.3 reorganized the handshake and key schedule, separating authentication algorithms from the cipher-suite definition and making ephemeral key agreement central to certificate-based connections.
Retirement of older versions proceeded through separate standards and implementation changes. RFC 6176 prohibited SSL 2.0 in 2011, and RFC 7568 prohibited SSL 3.0 in 2015. RFC 8996 formally deprecated TLS 1.0 and TLS 1.1 in 2021. These decisions reflected accumulated cryptanalytic findings, limitations of older protocol constructions, and the operational difficulty of maintaining legacy alternatives without exposing downgrade paths.
TLS version numbers also contain compatibility artifacts. TLS 1.3 does not simply place a new number in every field that historically indicated a version. Its ClientHello uses a legacy version value associated with TLS 1.2, while the supported_versions extension carries the actual version offer. Similar compatibility measures allow modern handshakes to traverse network devices that were built around assumptions about older TLS traffic. Consequently, interpreting TLS traffic requires understanding the negotiated extensions rather than treating every visible version field as authoritative.
Security objectives and position in the network stack
TLS establishes a protected channel between two application endpoints, conventionally called the client and server. Its principal objectives are confidentiality, integrity, and peer authentication. Confidentiality prevents an unauthorized observer from recovering application content. Integrity allows the receiver to detect unauthorized changes to protected data. Authentication connects the cryptographic exchange to an expected identity or previously established secret. These properties belong to a specific threat model: an attacker may observe, inject, modify, or discard network traffic but does not initially possess the endpoints’ relevant secret material.
Despite its name, TLS is not normally an alternative to a transport protocol. In its conventional form, it runs above a reliable, ordered byte stream, most commonly the Transmission Control Protocol (TCP), and below an application protocol such as the Hypertext Transfer Protocol (HTTP). The resulting arrangement is often described as HTTP over TLS over TCP. A TLS implementation receives application bytes, packages them into protected records, and passes those records to the underlying transport. TLS record boundaries need not correspond to application-message boundaries or TCP segment boundaries.
Related protocols adapt the design to other network requirements. Datagram Transport Layer Security (DTLS) supports datagram-oriented communication, where packets can be lost or reordered. QUIC incorporates the TLS 1.3 handshake and key schedule into a transport protocol built over UDP, but it does not carry application data inside ordinary TLS records. QUIC applies the derived keys to its own packet-protection mechanisms. This distinction matters when comparing protocol behavior, diagnosing failures, or describing what it means for a service to “use TLS.”
Authentication is often asymmetric in deployment. A public website normally authenticates its server using a certificate, while the browser authenticates the human user separately through a password, security key, or another application mechanism. TLS can also authenticate the client with a certificate, a mode commonly called mutual TLS. Successful server authentication therefore does not imply that the server has established the user’s identity, and an encrypted connection alone does not imply that either endpoint has authenticated a meaningful external identity.
The boundary of protection is equally important. TLS cannot prevent an endpoint from disclosing received plaintext, and it does not stop malicious scripts, application authorization errors, or phishing sites that possess valid certificates for their own domains. It also leaves some traffic characteristics observable, including endpoint addresses, timing, and approximate volumes. Its guarantees concern the protected channel and the identities established by its authentication process, not the complete security or trustworthiness of the applications using it.
Cryptographic components and key derivation
TLS combines several forms of cryptography because no single primitive efficiently supplies all the required properties. Public-key cryptography supports authentication and the establishment of shared secrets between parties that may never have communicated before. Symmetric cryptography then protects the much larger volume of application data. A cryptographic hash function binds the handshake messages together and supports key derivation, while digital signatures commonly demonstrate control of the private key associated with a certificate.
In a typical TLS 1.3 certificate-based handshake, the parties perform an ephemeral Diffie–Hellman key exchange, usually over an elliptic-curve group. Each endpoint generates a temporary private value and sends a corresponding public key share. Both can then compute a shared secret, while a passive observer who sees only the public values cannot feasibly recover it under the relevant mathematical assumptions. Authentication binds this exchange to the peer’s identity, preventing an active attacker from simply substituting its own key shares.
Ephemeral key exchange provides forward secrecy when temporary secrets are properly erased. If a server’s long-term signing key is later stolen, previously recorded sessions do not thereby become decryptable. This differs from the RSA key-transport mechanism available in older TLS versions, where the client encrypted a premaster secret using the server’s certificate key. A later compromise of that RSA private key could expose recorded sessions established with that mechanism. TLS 1.3 retains RSA as a possible signature technology but removes RSA key transport.
TLS 1.3 derives its working secrets through the HMAC-based Extract-and-Expand Key Derivation Function (HKDF). Its key schedule combines inputs such as a pre-shared key, when present, and the fresh Diffie–Hellman shared secret. Labeled derivations and transcript hashes produce separate secrets for handshake traffic, application traffic, exporters, and resumption. Client-to-server and server-to-client traffic use different keys. This separation limits accidental reuse and binds each derived value to a particular purpose and handshake context.
Application records in TLS 1.3 use authenticated encryption with associated data (AEAD). Examples include AES in Galois/Counter Mode and ChaCha20-Poly1305. These constructions provide confidentiality and an authentication tag covering both encrypted content and selected unencrypted context. Decryption succeeds only when the tag verifies; invalid protected records cause the connection to fail rather than delivering unauthenticated plaintext to the application.
A TLS 1.3 cipher-suite name consequently describes less than a TLS 1.2 cipher-suite name. For example, TLS_AES_128_GCM_SHA256 identifies the AEAD algorithm and the hash used by the key schedule. It does not identify the certificate’s key type or the key-exchange group, which are negotiated separately. This reduces the combinatorial complexity of defining suites that previously bundled key exchange, authentication, encryption, and hashing into a single selection.
Handshake negotiation and authentication
The TLS handshake establishes protocol parameters, authenticates peers as required, and derives traffic keys. A normal TLS 1.3 handshake begins with a ClientHello containing supported protocol versions, cipher suites, signature algorithms, key-exchange groups, and extensions. The client normally supplies one or more key shares immediately, allowing the server to proceed without first requesting a separate key-exchange message. This early transmission is a central reason TLS 1.3 can establish a fresh connection with fewer round trips than older handshakes.
The server replies with a ServerHello that selects the protocol version, cipher suite, and key share. Once both sides can compute the resulting shared secret, they derive handshake traffic keys. Subsequent server messages—including EncryptedExtensions and, in a certificate-authenticated exchange, Certificate and CertificateVerify—are encrypted. CertificateVerify contains a signature over a context-specific representation of the handshake transcript. It demonstrates that the server controls the private key corresponding to its certificate and binds that proof to the current negotiation.
The server’s Finished message authenticates the transcript using a key derived specifically for that purpose. The client validates the server’s identity and handshake messages, then sends its own Finished message. If the server requested certificate-based client authentication, the client also supplies its certificate and proof of private-key possession. Finished messages are not a substitute for identity validation: a cryptographically consistent handshake with an unauthorized peer is still unacceptable when the application expects a particular service.
The transcript binds negotiation choices to the authenticated exchange. An attacker who changes a supported-algorithm list, substitutes a key share, or modifies other covered handshake content causes the peers’ transcript computations to differ. The signatures or Finished checks then fail. TLS 1.3 also includes downgrade-detection mechanisms for situations in which a server capable of newer versions negotiates an older version. These mechanisms address specific protocol attacks; they do not make an obsolete version secure merely because it was selected without interference.
When the initial ClientHello does not contain a suitable key share, the server can issue a HelloRetryRequest asking the client to send another. This adds a round trip. The handshake includes strict rules about permitted changes and transcript construction so that retry processing does not become a way to replace unrelated negotiation data. Network captures may therefore show different valid sequences even when all participants support TLS 1.3.
Extensions connect the handshake to application requirements. Server Name Indication (SNI) lets a client identify the intended server name, enabling multiple domain names to share an address while using different certificates or policies. Application-Layer Protocol Negotiation (ALPN) selects the application protocol, such as HTTP/2, within the TLS exchange. Both mechanisms demonstrate that TLS negotiates not only cryptographic algorithms but also information needed to route and interpret the protected connection.
Record protection and connection state
After key establishment, TLS carries data through a record protocol. A record has a header and a payload; the payload may contain application bytes, handshake messages, or alerts, depending on protocol version and connection state. TLS is a stream-protection mechanism rather than an application framing system. A single application message may span multiple TLS records, and a record may contain bytes belonging to more than one application-level unit. Applications must therefore retain their own message-parsing rules.
TLS 1.3 encrypts an inner plaintext consisting of content, a content-type byte, and optional zero padding. The outer record ordinarily identifies the protected material as application data, even when the encrypted inner content is a handshake message or alert. This hides more protocol structure than earlier versions. The plaintext content fragment is limited to bytes, while the record format allows additional space for the inner type, padding, and cryptographic overhead. Record-size negotiation can impose smaller limits for constrained endpoints.
Each traffic direction maintains its own sequence number and cryptographic state. Conceptually, an AEAD operation can be written as
where is the traffic key, the nonce, the plaintext, the associated data, and the ciphertext and authentication tag. TLS 1.3 constructs a per-record nonce by combining a static initialization vector with the padded record sequence number. The record header is authenticated as associated data. Sequence numbers are implicit rather than transmitted as a separate field.
Correct nonce management is essential. Reusing a nonce with the same key can undermine the security of widely deployed AEAD algorithms. TLS implementations therefore must prevent sequence-number wraparound and respect algorithm-specific usage limits. TLS 1.3 supports KeyUpdate messages to replace application traffic secrets and derive fresh keys during an existing connection. These updates evolve the existing secret state; they do not perform a new Diffie–Hellman exchange or necessarily restore security after an attacker has learned current traffic secrets.
Alerts communicate conditions such as handshake failure, invalid certificates, or record-authentication errors. Once protection is established, alerts are normally encrypted like other protected content. The close_notify alert indicates that a peer will send no more data on that TLS sending direction. An underlying TCP closure without this signal can leave uncertainty about whether the protected stream ended normally. Whether that uncertainty permits a practical truncation attack depends on the application’s own framing and expectations.
TLS also distinguishes cryptographic ordering from application completeness. Within a connection, record protection detects unauthorized alteration and rejects records that do not match the expected cryptographic state. It does not determine that a downloaded document contains every intended section or that a transaction was committed. Those meanings belong to the application protocol, which may use lengths, explicit termination messages, transaction identifiers, or additional integrity checks.
Certificates, names, and the public trust system
Most public TLS services authenticate through a digital certificate that binds a public key to identifiers such as domain names. The dominant format is X.509. A server generally supplies its own certificate together with intermediate certificates that help the client build a certification path to a locally trusted root. A certificate authority (CA) signs certificates after performing the checks required by its validation policies and the relevant application ecosystem.
Certificate validation is more than checking a signature. A client evaluates whether the certification path leads to an acceptable trust anchor, whether certificates are within their validity periods, whether critical extensions are understood, and whether constraints and key usages permit the intended operation. It must also verify that the service identity expected by the application matches an identity authorized by the certificate. For modern domain-name authentication, this normally involves names in the certificate’s subject alternative name extension.
This process forms part of a public key infrastructure (PKI), but the trust policy is not fixed by TLS alone. Browsers and operating systems distribute root stores and impose additional requirements. Private organizations may distribute their own trust anchors for internal services. A self-signed certificate can be secure when its key or certificate is authenticated through an appropriate independent mechanism; it simply does not acquire public trust merely by being self-signed. Conversely, a publicly trusted certificate demonstrates the validated binding it contains, not the general honesty of the operator.
Certificate revocation addresses certificates that should no longer be accepted before their scheduled expiration. Mechanisms include certificate revocation lists and the Online Certificate Status Protocol (OCSP). With OCSP stapling, a server supplies a signed status response rather than requiring every client to query a responder directly. Revocation introduces operational challenges: responders may be unavailable, status information can become stale, and strict failure behavior can disrupt legitimate connections. Different client ecosystems consequently use different combinations of revocation mechanisms and local policy.
Certificate Transparency provides a complementary approach by placing publicly trusted certificate issuance under observation. Append-only logs accept certificate-related submissions and return signed evidence that can be checked under applicable browser policies. Domain owners and monitors can use the logs to detect unexpected issuance. Transparency does not itself prove that every logged certificate was properly issued, and logging is not the same as revoking a certificate; its function is to make issuance more visible and accountable.
The long-term private key remains a critical asset. Servers may hold it in software, delegate signing operations to a separate service, or use a hardware security module. Such arrangements change where compromise can occur without changing the certificate’s logical role. They must also account for operational realities such as renewal, deployment consistency, supported signature schemes, and the need to remove a compromised key from service.
Session resumption, pre-shared keys, and early data
Establishing a new TLS session requires computation and network exchanges. Session resumption reduces this cost by allowing a new connection to rely on cryptographic state derived from an earlier one. TLS 1.2 supported session identifiers and session tickets, with different mechanisms for retaining or reconstructing state. TLS 1.3 reorganized resumption around pre-shared keys (PSKs), creating a common framework that can also accommodate secrets provisioned through an external process.
In TLS 1.3, a server can send a NewSessionTicket message after the handshake. The client associates the ticket with a resumption secret and other relevant session information. On a later connection, it presents a ticket identity and a binder that proves knowledge of the corresponding PSK while binding the offer to the new ClientHello. The server can accept that PSK and, depending on the negotiated mode, combine it with a fresh Diffie–Hellman exchange.
The distinction between PSK-only and PSK-with-Diffie–Hellman operation affects security. A fresh Diffie–Hellman contribution provides forward secrecy for the resumed connection’s ordinary traffic against later compromise of the PSK, assuming the ephemeral secrets remain protected and are erased. PSK-only establishment lacks that fresh contribution. Certificate-based authentication may be omitted in an accepted resumption handshake because the PSK carries forward an authentication context from the earlier exchange; this makes correct handling of the associated identity and policy important.
TLS 1.3 also supports zero-round-trip-time, or 0-RTT, early data. A client with a suitable PSK can send application data before receiving the server’s first response. This can reduce latency for repeated interactions, but early data has weaker security properties than ordinary post-handshake application data. In particular, it is not forward secret against later compromise of the relevant PSK, and the protocol cannot generally guarantee that an attacker will not replay it.
Replay is consequential when an application operation changes state. Repeating a request that triggers a purchase, transfers funds, or consumes a one-time credential can have effects even if the attacker cannot decrypt or modify the request. Servers can maintain anti-replay state, restrict ticket use, or reject early data, but distributed deployments complicate coordination. TLS therefore exposes early-data acceptance as a distinct condition rather than treating it as interchangeable with ordinary authenticated application traffic.
Resumption also has operational and privacy dimensions. Ticket-encryption keys may be shared across server fleets to allow resumption after load balancing, increasing the scope of damage if those keys are compromised. Long-lived or improperly reused ticket identifiers can contribute to linkability. Ticket lifetimes, key rotation, cache management, and the binding of resumed sessions to application policy are thus part of the security design, not merely performance tuning. A successful resumption establishes a new connection; it does not imply that every property of the earlier application session remains valid.
Application deployment and operational architecture
TLS is widely associated with websites, but its deployment patterns differ across applications. HTTPS commonly begins TLS immediately after establishing the underlying transport connection. Other protocols historically begin in plaintext and negotiate an upgrade, often through a command named STARTTLS. Examples include uses of SMTP for mail transport and access protocols such as IMAP. An upgrade design requires particular care because the negotiation that decides whether to invoke TLS can occur before the channel is protected.
If an application permits plaintext fallback after a failed or removed upgrade offer, an active attacker may prevent encryption without breaking TLS cryptography. Policies outside the handshake determine whether encryption is mandatory and how the intended server is authenticated. This is especially significant in inter-server email, where routing, compatibility, and delivery requirements differ from browser connections to an explicitly selected HTTPS origin. “Supports TLS” therefore says less than a complete description of when TLS is required and what peer identity is verified.
Large services frequently terminate TLS at a reverse proxy, load balancer, or content delivery network. That system is the cryptographic endpoint and can read the plaintext. A subsequent connection from the proxy to an application server may use another TLS session or a different protected network arrangement. The presence of HTTPS between a browser and a proxy does not establish end-to-end encryption to every backend service. Each connection has its own peer identities, trust decisions, and key-management requirements.
In microservice architectures, mutual TLS can authenticate workloads communicating within a service network. Certificates may identify services or workload instances rather than public domain names, and automated systems can issue short-lived credentials and rotate them frequently. The transport identity then supplies an input to authorization decisions: it does not replace them. A service may have a valid certificate and still lack permission to invoke a particular operation or access a particular tenant’s data.
Implementation choices affect both interoperability and risk. Libraries such as OpenSSL provide protocol processing, certificate validation facilities, and cryptographic primitives, while applications configure names, trust stores, credentials, and allowed behavior. Some operating systems supply shared TLS facilities; other applications bundle their own libraries. Centralized libraries can make security fixes broadly available, but bundled copies and long-lived devices can complicate updates. Differences in default validation behavior are especially important when an application uses a general-purpose library rather than a browser’s higher-level networking stack.
Performance depends on more than the nominal cipher. Handshake latency, certificate-chain size, connection reuse, resumption, hardware acceleration, and record sizing all matter. HTTP/2 can multiplex requests over one connection, reducing repeated handshake costs, while HTTP/3 uses QUIC’s integrated TLS handshake. Operational monitoring must distinguish certificate expiry, unsupported protocol versions, authentication failures, and transport failures, since similar user-visible symptoms may originate in entirely different layers.
Attacks, privacy limits, and continuing research
TLS security has evolved through attacks on protocol design, cryptographic constructions, implementations, and deployment practices. A man-in-the-middle attack succeeds when an adversary can impersonate a peer or interfere with authentication, for example when certificate validation is disabled or a trust anchor is compromised. Strong encryption cannot compensate for accepting the wrong public key. Other attacks exploit side effects of otherwise legitimate exchanges rather than directly recovering a private key.
Several prominent findings shaped later protocol versions. BEAST, publicly demonstrated in 2011, targeted aspects of TLS 1.0’s cipher-block-chaining construction under specific browser conditions. CRIME, disclosed in 2012, showed how compression could expose secrets through changes in encrypted length. POODLE, disclosed in 2014, exploited SSL 3.0 padding behavior and highlighted the danger of fallback to obsolete protocols. TLS 1.3’s removal of legacy CBC suites and TLS-level compression reduced these classes of protocol complexity, although application-level compression can still create distinct information leaks.
Implementation failures are a separate category. Heartbleed, disclosed in April 2014, was an OpenSSL memory-disclosure vulnerability in its implementation of the TLS heartbeat extension, not a failure of the underlying encryption algorithms. It demonstrated that a protocol can use sound cryptographic primitives while a software defect exposes keys or application data. Timing and other side-channel attacks likewise exploit differences in computation, memory access, or error handling. Constant-time cryptographic code, careful parsing, and uniform handling of invalid inputs are therefore important implementation properties.
TLS does not eliminate traffic analysis. Packet timing and lengths can reveal patterns even when payloads are encrypted. Ordinary TLS ClientHello messages also historically exposed information such as the requested server name. Encrypted ClientHello (ECH) addresses this by encrypting a sensitive inner ClientHello using a public configuration supplied for the service, while retaining an outer form needed for connection handling. Its privacy benefits depend on deployment conditions, configuration distribution, and the surrounding network; it does not by itself hide the client’s destination IP address or protect unencrypted Domain Name System queries.
The prospect of large-scale cryptographically relevant quantum computers creates another line of development. Such machines would threaten the mathematical problems underlying widely deployed RSA and elliptic-curve authentication and key establishment. An attacker could record encrypted traffic now and attempt to decrypt it later if the key-establishment mechanism becomes breakable. Research and deployment work on post-quantum cryptography includes hybrid key exchanges that combine conventional and post-quantum components, alongside the separate problem of migrating certificate signatures.
Protocol analysis increasingly uses formal verification and machine-checked models to examine handshake states, authentication claims, and key separation. These methods can identify subtle errors but depend on the assumptions and implementation details represented in the model. Deployment also creates constraints: protocol ossification occurs when network equipment accepts only familiar message patterns and blocks legitimate evolution. TLS research therefore spans mathematical proofs, implementation assurance, privacy engineering, and the practical behavior of the networks over which new mechanisms must operate.