boiler plate code for https