support secure and unsecure connections