Use HTTPS for the client and handle 500 errors