Changes to make it ssl friendly