simple https and http handling