add a flag to switch on/off TLS