Added handling of https