networking · intermediate · ~15 min
Read the TLS record type byte.
A TLS record starts with a 1-byte content type (22 = handshake, 23 = application data). Implement int tls_record_type(const unsigned char *rec) returning rec[0].
int tls_record_type(const unsigned char *rec) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.