Must cater for http and https