3 ms·
TLS 1.3 has some published test vectors where if you understand the inputs (which is tricky) and do the same operations, you'll end up with the same outputs as
by toast0 5y ago
TLS 1.3 has some published test vectors where if you understand the inputs (which is tricky) and do the same operations, you'll end up with the same outputs as the test vectors and that should maybe work with a real server too.
Still, it helps a ton to get error logs (or step through debugging) from a real server to figure out what you messed up. For every value you send in a TLS handshake, it feels like you've got to send the length three different times, in different numbers of bytes and sometimes adding the bytes it takes to send the length.
But, if you can smash through all that, you can get a reasonably working TLS 1.3 client in about a week of fiddling. If your runtime has a decent api to validate certificates, you can call out to that too (the less you personally do with x.509, the better)
Edit: link to vectors https://datatracker.ietf.org/doc/rfc8448/ https://datatracker.ietf.org/doc/rfc8448/
- drewg123 5y agoNice, I didn't know that. I did most of the work in ~2017 before TLS 1.3.
- syncsynchalt 5y agoAgreed, I second that recommendation for anyone interested in this stuff to write a toy TLS implementation. Here's mine: https://github.com/syncsynchalt/tincan-tls https://github.com/syncsynchalt/tincan-tls