only use TLS if TLS is enabled