Changed the server connection code to use HTTPS