mod_tls: Refactor to simplify detection of whether we can do TLS on a connection