Toggle http/https where necessary