Adding TLS state tracking