result = !String.IsNullOrWhiteSpace(currentStore.SecureUrl) ?
//Secure URL specified.
//So the store owner doesn't want it to be detected automatically.
//In this case let's use the specified secure URL
currentStore.SecureUrl :
//Secure URL is not specified.
//So the store owner wants it to be detected automatically.
result.Replace("http:/", "https:/");