Add initial (working?) version of HTTPS support