Fixed curl download for https connections