TLS: harden error-detection in TLS proxy process