added support for HTTPS