Better https handling