This happened for me when I had https_proxy etc set with a https protocol (e.g. set to https://localhost:3128) instead of just http.
This happened for me when I had https_proxy etc set with a https protocol (e.g. set to https:/ /localhost: 3128) instead of just http.