ConnectionRefusedError error on 302 redirects

<a name="top"/>302 redirects insert localhost into url (and change scheme from https to http).

Aside: urllib3 works fine:

````python
http = urllib3.PoolManager()
url = 'https://www.apachelounge.com/download/VC14/binaries/httpd-2.4.26-win32-VC14.zip'
r = http.request('GET', url)
````
## Expected Result
No exception
## Actual Result
Exception raised (see below for both [2.7.13](#2.7.13) and [3.6.1](#3.6.1) failures)
## Reproduction Steps
````python
import requests
url = 'https://www.apachelounge.com/download/VC14/binaries/httpd-2.4.26-win32-VC14.zip'
r = requests.head(url)
print(r.status_code)
print(r.headers)
r = requests.head(url, allow_redirects=True)
print(r.status_code)
print(r.headers)
````
## System Information
````
{
  "chardet": {
    "version": "3.0.4"
  },
  "cryptography": {
    "version": ""
  },
  "implementation": {
    "name": "CPython",
    "version": "3.6.1"
  },
  "platform": {
    "release": "7",
    "system": "Windows"
  },
  "pyOpenSSL": {
    "openssl_version": "",
    "version": null
  },
  "requests": {
    "version": "2.18.1"
  },
  "system_ssl": {
    "version": "100020bf"
  },
  "urllib3": {
    "version": "1.21.1"
  },
  "using_pyopenssl": false
}
````
<a name="2.7.13"></a>

## Exception (Python 2.7.13) [↑back to top](#top)
````batch
C:\>py get.py
302
{'Keep-Alive': 'timeout=10, max=100', 'Server': 'Apache/2.4.26 (Win64)', 'Connection': 'Keep-Alive',
'Location': 'http://localhost/download/VC14/binaries/httpd-2.4.26-win32-VC14.zip', 'Da
te': 'Sun, 18 Jun 2017 22:33:13 GMT', 'Content-Type': 'text/html; charset=iso-8859-1'}
Traceback (most recent call last):
  File "get.py", line 11, in <module>
    r = requests.head(url, allow_redirects=True)
  File "c:\python\lib\site-packages\requests\api.py", line 98, in head
    return request('head', url, **kwargs)
  File "c:\python\lib\site-packages\requests\api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "c:\python\lib\site-packages\requests\sessions.py", line 502, in request
    resp = self.send(prep, **send_kwargs)
  File "c:\python\lib\site-packages\requests\sessions.py", line 634, in send
    history = [resp for resp in gen] if allow_redirects else []
  File "c:\python\lib\site-packages\requests\sessions.py", line 212, in resolve_redirects
    **adapter_kwargs
  File "c:\python\lib\site-packages\requests\sessions.py", line 612, in send
    r = adapter.send(request, **kwargs)
  File "c:\python\lib\site-packages\requests\adapters.py", line 504, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=80): Max retries exceeded with url: /download/VC14/binaries/httpd-2.4.26-win32-VC14.zip (Caused by NewConnec
tionError('<urllib3.connection.HTTPConnection object at 0x00000000035D5D30>: Failed to establish a new connection: [Errno 10061] No connection could be made because the target machine act
ively refused it',))
````
<a name="3.6.1"></a>
## Exception (Python 3.6.1) [↑back to top](#top)
````batch
C:\>py get.py
302
{'Date': 'Sun, 18 Jun 2017 22:24:43 GMT', 'Server': 'Apache/2.4.26 (Win64)', 
'Location': 'http://localhost/download/VC14/binaries/httpd-2.4.26-win32-VC14.zip', 'Content-Type': 'text/html;
 charset=iso-8859-1', 'Keep-Alive': 'timeout=10, max=100', 'Connection': 'Keep-Alive'}
Traceback (most recent call last):
  File "c:\python\lib\site-packages\urllib3\connection.py", line 141, in _new_conn
    (self.host, self.port), self.timeout, **extra_kw)
  File "c:\python\lib\site-packages\urllib3\util\connection.py", line 83, in create_connection
    raise err
  File "c:\python\lib\site-packages\urllib3\util\connection.py", line 73, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\python\lib\site-packages\urllib3\connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "c:\python\lib\site-packages\urllib3\connectionpool.py", line 356, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "c:\python\lib\http\client.py", line 1239, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "c:\python\lib\http\client.py", line 1285, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "c:\python\lib\http\client.py", line 1234, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "c:\python\lib\http\client.py", line 1026, in _send_output
    self.send(msg)
  File "c:\python\lib\http\client.py", line 964, in send
    self.connect()
  File "c:\python\lib\site-packages\urllib3\connection.py", line 166, in connect
    conn = self._new_conn()
  File "c:\python\lib\site-packages\urllib3\connection.py", line 150, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x000000000354AF28>: Failed to establish a new connection: [WinError 10061] No connection could be made
 because the target machine actively refused it

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\python\lib\site-packages\requests\adapters.py", line 440, in send
    timeout=timeout
  File "c:\python\lib\site-packages\urllib3\connectionpool.py", line 649, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "c:\python\lib\site-packages\urllib3\util\retry.py", line 388, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=80): Max retries exceeded with url: /download/VC14/binaries/httpd-2.4.26-win32-VC14.zip (Caused by NewConnectio
nError('<urllib3.connection.HTTPConnection object at 0x000000000354AF28>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine act
ively refused it',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "get.py", line 11, in <module>
    r = requests.head(url, allow_redirects=True)
  File "c:\python\lib\site-packages\requests\api.py", line 98, in head
    return request('head', url, **kwargs)
  File "c:\python\lib\site-packages\requests\api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "c:\python\lib\site-packages\requests\sessions.py", line 502, in request
    resp = self.send(prep, **send_kwargs)
  File "c:\python\lib\site-packages\requests\sessions.py", line 634, in send
    history = [resp for resp in gen] if allow_redirects else []
  File "c:\python\lib\site-packages\requests\sessions.py", line 634, in <listcomp>
    history = [resp for resp in gen] if allow_redirects else []
  File "c:\python\lib\site-packages\requests\sessions.py", line 212, in resolve_redirects
    **adapter_kwargs
  File "c:\python\lib\site-packages\requests\sessions.py", line 612, in send
    r = adapter.send(request, **kwargs)
  File "c:\python\lib\site-packages\requests\adapters.py", line 504, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=80): Max retries exceeded with url: /download/VC14/binaries/httpd-2.4.26-win32-VC14.zip (Caused by NewConnec
tionError('<urllib3.connection.HTTPConnection object at 0x000000000354AF28>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine
actively refused it',))
````
[↑back to top](#top)

Hey @rasa, you'll find that the redirect link being provided by this endpoint is `http://localhost/download/VC14/binaries/httpd-2.4.26-win32-VC14.zip`. Unless you're hosting this service on your machine on port 80, that connection will never be established. 

I ran a quick test with Curl, and you'll see a similar failure with that tool as well. This behaviour appears to be a failure on the part of the apachelounge.com server, and you'll want to contact them about getting that resolved.

@rasa, apologies. I replied a little too hastily. The issue you're seeing is related to the `User-Agent` you're providing the server. They've apparently blacklisted both Curl and Python-Requests as user agents, so you'll need to spoof it to access the download. This is why urllib3 works while the other two do not.

You can accomplish this by providing a header as shown below:

```python
import requests
url = 'https://www.apachelounge.com/download/VC14/binaries/httpd-2.4.26-win32-VC14.zip'
r = requests.get(url, headers={'User-Agent': 'Definitely-Not-Requests'})
```

Thank you for the quick, and detailed, response!