added HTTPS support