Add possibility to switch between secure and insecure connection