by tialaramex · 2mo ago · 0 comments
Specifically TLS 1.3.
They don't explain, but late in TLS 1.3 development it was discovered that if you just say you're talking TLS 1.3 by increasing the version byte in the packet, as the protocol was designed almost thirty years ago, crap "security" middleboxes at a significant number of sites freak out and nothing works. Deploying a protocol which just doesn't work for, say, 10% of systems is unacceptable.
So the way TLS 1.3 actually works is - you begin the conversation pretending to be a TLS 1.2 client resuming an earlier conversation. You pick an arbitrary random long ID for this non-existent conversation, and you say you also happen to know a TLS 1.2 extension, and that bogus "extension" is actually your entire TLS 1.3 connection setup.
If the server you reached also knows TLS 1.3 they understand this charade, they reply "accepting" the resumption and since a TLS 1.2 resumption would just be encrypted application data, all TLS 1.3 just has the rest of the conversation labelled as TLS 1.2 application data and the dumb "security" middleboxes won't molest it. Nothing to see here.
If it does not know TLS 1.3 then this made-up ID won't match an actual conversation it has ever had, it can't resume that conversation, how about a new connection using the older protocol version, and everything proceeds as usual for the older protocol.
The insight in TLS 1.3 was that we can guess a KEX and if we're correct we win a free roundtrip overhead†. So the history is that in TLS 1.2 you will always eat two round trips to talk HTTPS the first time, though in some cases you can reduce it to only one to "resume" conversations, in TLS 1.3 you can spend only one round trip even the first time if you guess the right KEX, and as few as zero round trips in some specific cases.
† This also means there's a strong incentive to have few KEX options, a new KEX must be unarguably better for a large constituency so that it's worth losing the round trip bonus to get a better KEX until your KEX is so popular that everybody will guess that KEX instead of the previous most popular.