How HTTPS Works: Watch a TLS 1.3 Handshake in Python
In a TLS 1.3 handshake, every handshake message after the two hellos is encrypted, but the site name is not.
Video #280 ยท How it works, by example
Steps in the video
Files
- local_server.py (23 lines)
- make_cert.py (25 lines)
- pump.py (27 lines)
- run.py (37 lines)
- watch.py (38 lines)
Tested with
Python 3.12.15 | cryptography==50.0.2
What this does not show
One handshake in memory on one machine, with a throwaway self-signed certificate; it names record types only and does not show certificate chains, session resumption or Encrypted Client Hello.
Sources
Learning IT by Example.