Added HTTPS support and now checks if server returns correct info.