A socket closes. The kernel says EOF. The application decides it has the whole answer — and sometimes it is wrong.
Picture a response arriving in good order. Every TLS record that lands passes authentication. Then the transport ends. Those facts prove the prefix was protected and the conversation stopped. They do not prove the prefix was the whole reply. A truncated answer and a complete one can wear the same face at the socket layer, and the difference only shows up later — in a half-written file, a short JSON body, a payment that never quite finished.
That gap is where close_notify lives. It is TLS's way of putting the goodbye inside the protected conversation, so that "I have finished sending" becomes a statement the receiver can trust rather than an inference from silence.
Why a bare EOF proves less than it seems
The problem is sharpest when the application has no independent terminator. An HTTP response that promised 10,000 octets and delivered 9,996 has already confessed. A chunked response missing its final zero-sized chunk has confessed too. But a response delimited only by connection closure has no such witness. A clean end and a missing suffix look identical unless the protected protocol says which one occurred.
TLS 1.0, published in 1999 as RFC 2246, named the risk without ceremony: client and server needed shared knowledge that the connection was ending, or truncation could slip through. Its answer was the close_notify alert. The sender placed a statement inside TLS that it would send no more messages on that connection. Records arriving after the alert were to be ignored.
This did not turn TLS into a document format. It drew a boundary TLS could actually own: no more protected messages from this sender. Whether the records already received added up to a complete response, file, command or transaction remained the application's problem.
The first rule tied closure to future trust
TLS 1.0 attached a stiff consequence. If a connection ended without proper closure alerts, the session became unresumable. The next connection could not reuse that session state.
That linked two ideas that look natural together and are not: an unproved ending on one connection, and permission to continue an earlier cryptographic relationship later. A peer that had not completed the closing exchange lost the shortcut of resumption. It was conservative, coherent, and — as it turned out — slightly too strict for the Internet to bear.
Practice pushed back. TLS 1.2 records, in its own history, that TLS 1.1 had removed the automatic no-resumption consequence to conform with widespread implementation behaviour. The alert obligation stayed. The punishment for a missing close exchange did not. Closure evidence and resumption policy were related, but they did not have to be the same decision — an early lesson in separating the semantic boundary from the policy built on top of it.
The old reply rule could cut the other direction
Before TLS 1.3, receiving close_notify carried an immediate reciprocal duty. The peer had to send its own alert, close down the connection and discard pending writes. The initiator did not need to wait for that reply before closing its read side.
That rule made closure look symmetrical even when the application was not. One endpoint could be done sending while still expecting a final response. If the receiver of the first alert dutifully discarded pending writes, the mechanism designed to resist truncation could truncate the reverse direction itself — a fire exit that slams the other door.
TLS 1.3 repaired the model by treating close_notify as orderly closure of one direction. Sending it closes the sender's write side; it does not close the read side. The peer no longer has to discard pending reverse writes or answer immediately. Each direction can finish when the application using that direction is actually done.
The standard also states the residual uncertainty with unusual precision. If a transport-level close arrives before close_notify, the receiver cannot know that all data sent by the peer was received. Earlier authenticated records are not retroactively corrupted. What remains uncertain is the missing future: records that may have existed after the last one observed.
HTTP supplied the boundary TLS could not see
HTTP over TLS separated cryptographic integrity from message completeness. A premature close did not make received data insecure; it meant later data might have been truncated. Because TLS could not see HTTP request and response boundaries, the client had to examine HTTP framing.
The modern HTTP/1.1 specification keeps that division. A declared Content-Length is evidence when exactly that many octets arrive. Chunked coding has a terminal zero-sized chunk. If either boundary is missing, the message is incomplete. A close-delimited response, however, is complete over TLS only after a valid closure alert; otherwise accepting the prefix as final can expose the implementation to attack.
This makes close_notify neither universal nor redundant. It is decisive where closure is the message delimiter. Where the application has already proved completion, an incomplete TLS close can be classified without pretending that the completed message lost integrity. The application, not the transport library alone, owns that distinction.
HTTP/2 made the layering easier to observe. In RFC 9113, END_STREAM closes one HTTP stream direction while other streams continue on the same connection. It is application-stream finality, not TLS-connection finality. A stream can prove its own end long before the shared TLS channel performs its separate closure.
One alert, one claim
close_notify does not authenticate a person, authorize a transaction, confirm that an application consumed data or certify that every higher-layer message was complete. It makes one bounded statement: the sender will send no more TLS messages in that direction.
That modest scope is why the mechanism endures. A bare EOF is an event. A protected closure alert is evidence about intent. A Content-Length, chunk terminator or END_STREAM is evidence about application structure. Reliable systems keep those facts separate and combine them only when their scopes align.
The lesson is older than TLS and larger than it. Protocols that confuse "the bytes stopped" with "the message ended" do not fail loudly; they fail at the edges, in the half-second before a retry, in the cache that promotes a prefix, in the operator who reads "complete" and moves on. The fix is not more cryptography. It is the discipline of giving each layer only the authority it has actually earned — and letting the goodbye be a sentence, not a silence.
Sources and limits
The account uses RFC 2246, RFC 2818, RFC 5246, RFC 8446, RFC 9112 and RFC 9113. They define protocol behaviour and historical changes, not current library defaults, deployment share or the cause of any observed missing alert.
Member Briefing
Read the full trend briefing
Members read the full briefing with the source notes behind every finding.
Strategic Circle
A daily briefing in your language, built from changes we have verified.
Join for USD 20/monthCancel anytime.
Members also get the full research library, a daily briefing on the networks they follow and the private forum.






