Changes to be able to switch to SSL connections