added support for https endpoint