Added a TLS debug level option, use debugging hook