Fix logic when determining protocol
Switch to tls naming convention