Fix http and https issues