ZeroReturnError exception on GET request to facebook.com

Running on Python 2.7.8 with:
- `pyOpenSSL==0.14`
- `ndg-httpsclient==0.3.3`
- `pyasn1==0.1.7`
- `requests==2.5.1`

When I run this:

``` python
requests.get("http://www.facebook.com/", headers={"Connection" : "close"})
```

I get the following exception:

```
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "[venv]/local/lib/python2.7/site-packages/requests/api.py", line 65, in get
    return request('get', url, **kwargs)
  File "[venv]/local/lib/python2.7/site-packages/requests/api.py", line 49, in request
    response = session.request(method=method, url=url, **kwargs)
  File "[venv]/local/lib/python2.7/site-packages/requests/sessions.py", line 461, in request
    resp = self.send(prep, **send_kwargs)
  File "[venv]/local/lib/python2.7/site-packages/requests/sessions.py", line 599, in send
    history = [resp for resp in gen] if allow_redirects else []
  File "[venv]/local/lib/python2.7/site-packages/requests/sessions.py", line 192, in resolve_redirects
    allow_redirects=False,
  File "[venv]/local/lib/python2.7/site-packages/requests/sessions.py", line 610, in send
    r.content
  File "[venv]/local/lib/python2.7/site-packages/requests/models.py", line 730, in content
    self._content = bytes().join(self.iter_content(CONTENT_CHUNK_SIZE)) or bytes()
  File "[venv]/local/lib/python2.7/site-packages/requests/models.py", line 655, in generate
    for chunk in self.raw.stream(chunk_size, decode_content=True):
  File "[venv]/local/lib/python2.7/site-packages/requests/packages/urllib3/response.py", line 256, in stream
    data = self.read(amt=amt, decode_content=decode_content)
  File "[venv]/local/lib/python2.7/site-packages/requests/packages/urllib3/response.py", line 186, in read
    data = self._fp.read(amt)
  File "/usr/lib/python2.7/httplib.py", line 567, in read
    s = self.fp.read(amt)
  File "/usr/lib/python2.7/socket.py", line 380, in read
    data = self._sock.recv(left)
  File "[venv]/local/lib/python2.7/site-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 188, in recv
    data = self.connection.recv(*args, **kwargs)
  File "[venv]/local/lib/python2.7/site-packages/OpenSSL/SSL.py", line 995, in recv
    self._raise_ssl_error(self._ssl, result)
  File "[venv]/local/lib/python2.7/site-packages/OpenSSL/SSL.py", line 851, in _raise_ssl_error
    raise ZeroReturnError()
OpenSSL.SSL.ZeroReturnError
```

According to the pyOpenSSL docs on `ZeroReturnError` this is an indication that remote closed the connection cleanly:

http://pyopenssl.readthedocs.org/en/latest/api/ssl.html#OpenSSL.SSL.ZeroReturnError

I'm guessing this exception should probably be handled somewhere along the call path instead of propagating to the caller.

Running under Python 3.4.2 the request goes through.


This is better filed over on [urllib3](/shazow/urllib3).


Also, ping @shazow 


This should be fixed in 2.5.2 or later but you should upgrade to 2.6.0 either way.


No need to report this to urllib3 either.


Confirmed. 

I could swear I checked for an updated version before reporting :)

Thanks.


No worries @chrj. Hopefully now that there's a bug here, people will see it and not open a new one. =D It's still appreciated. :D :+1: