This isn't opening anything, though, right? This is just providing a correct address? Would a boolean flag for enabling HTTPS be an applicable solution?