try to support HTTPS (WIP)