Added ability to switch on and off SSL encryption