Every encrypted web page you have ever loaded began with a decision made before the first byte of HTTP: this connection is secure. The port said so. The URL said so. The browser had already picked a side.

In May 2000, two engineers named Rohit Khare and Scott Lawrence published a memo arguing that the decision did not have to be made in advance. RFC 2817, “Upgrading to TLS Within HTTP/1.1”, let an ordinary request on port 80 ask the server to switch the same TCP connection to TLS mid-sentence — hostname first, certificate second, no second listener, no redirect. It defined the Upgrade: TLS/1.0 token, the 101 Switching Protocols handshake, and the 426 Upgrade Required status code the web still uses.

Then the memo told you exactly how it would end.

What RFC 2817 actually proposed

The mechanics fit on a napkin. A client sends Upgrade: TLS/1.0 with Connection: Upgrade. If it cannot bear to receive even one plaintext byte, it sends an OPTIONS request first, so the switch happens before any document is transmitted. The server agrees with 101 Switching Protocols, lists the stack bottom-up as TLS/1.0, HTTP/1.1, runs the handshake, and then answers the original request inside the new encrypted channel.

There is a server-driven version too, and it produced the status code that outlived everything else in the document: 426 Upgrade Required, the machine-readable way of saying your connection is not good enough, and here is what would be.

The memo’s own summary is almost cheeky in its modesty: the point was to let secured and unsecured traffic “share the same well known port”.

The prize was never port conservation. It was the hostname.

RFC 2817 does mention that a second secure port eats into the supply of well-known ports — the kind of argument that sounds urgent inside a working group and irrelevant everywhere else. The real prize was name-based virtual hosting under encryption.

The memo’s diagnosis of TLS was blunt: it “has been hobbled by the same limitation as earlier versions of HTTP: the initial handshake does not specify the intended hostname, relying exclusively on the IP address”. One certificate per IP address. One secure site per IP address. And IP addresses were the scarce thing everyone was already fighting over. A cleartext Upgrade preamble carrying a Host: header hands the server the name before it picks a certificate. The memo says so plainly: this “will allow ISPs to provide secure name-based virtual hosting as well”.

That is Server Name Indication, six years early and one layer down. SNI eventually solved the same problem from inside the TLS handshake, in RFC 4366, and the world adopted it — because it changed the handshake rather than the meaning of a request.

The memo predicted its own reception

RFC 2817 does not pretend to be winning. Its introduction reads like a post-mortem filed in advance: there had been “broad acceptance of the concept behind this proposal, but little interest in implementing alternatives to port 443 for generic Web browsing”.

Read that again. The idea was accepted. The concept was endorsed. Nobody built it.

The memo is equally careful not to disturb the thing already winning: “nothing in this memo affects the current interpretation of https: URIs”. A standard that promises not to change anything is a standard that has been told its place.

Why the web chose the padlock

Port 443 is not a better idea than an in-place upgrade. It is a more visible one, and visibility is most of what a security mechanism needs in order to become a habit.

Four things favoured the second door. It was legible: https:// fits in a URL bar, a purchase order and a compliance checklist, and the padlock turned a protocol into a brand. It was local: a new listener, a new certificate, a new firewall rule — decisions one team could make without asking every proxy on the path to understand a connection that changes its own rules halfway through. It was already there. And it was sellable: certificates, dedicated IP addresses and load balancers were products, and the second door had a cash register beside it.

The upgrade asked something harder. It asked every client, server and intermediary to agree in advance to a conversation that would renegotiate itself mid-sentence. That is a small technical cost and a large institutional one.

So the web got a decade of redirects from http:// to https://, a padlock in the address bar, and an industry built on the assumption that encryption is a place you go rather than a thing you ask for.

The mechanism outlived the memo

The Upgrade header did not die with the ambition. It is the same header a browser sends to open a WebSocket, and Connection: Upgrade is still the handshake that turns an HTTP request into something that is no longer HTTP. The 101 response is still the moment a connection changes its identity.

HTTP/2 kept a cleartext upgrade path called h2c; browsers ignored it in favour of negotiating over TLS with ALPN — the same verdict, delivered twice. And 426 Upgrade Required quietly became plumbing, a status code that exists because a memo in 2000 wanted a polite way to say: not like this.

The memo’s most durable exports were two lines in an IANA registry: an upgrade token and a status code. HTTP learned to become other protocols. It just never became encrypted that way.

What RFC 2817 still teaches about standards and lock-in

Lu Heng makes the point in his Note on running-code primacy: “When rough consensus and running code diverge, running code comes first.” RFC 2817 is the cleanest available proof. The consensus was never in doubt — the memo says so itself. The running code went the other way, and by the time the document was printed, the argument was already over.

The deeper lesson is about where a decision lives. Bind encryption to the URL and the port, and the switch belongs to the address: visible, checkable, cacheable, sellable, impossible to miss. Bind it to the connection, and the switch belongs to the conversation: elegant, incremental, and invisible to everyone who is not a protocol engineer. The web chose the layer that could be seen.

There was a second-order bill. Because encryption was tied to the hostname, every secure site needed its own certificate, and certificates were manual, annual and expensive — the exact friction RFC 2817 tried to route around. The industry eventually removed the friction instead of the port: Let’s Encrypt issued its first certificate in 2015, automated issuance became ordinary, and port 443 got cheap. The upgrade was never needed again.

Which is why RFC 2817 is not a failed standard. It is a control experiment. The same problem was solved twice — once from inside the protocol, once from inside the address — and the address won because it was the only version a user could see.

The road not taken is still open

Upgrade: TLS/1.0 remains legal. Nothing repealed it. A server that wanted to honour it tomorrow could; almost no client would ask.

That is the quietest way a standard can lose: not repealed, just unvisited. RFC 2817 is still in force, still correct, still waiting on port 80 — a door left open for a conversation the web decided, politely and permanently, not to have.