Problem with proxy + https

GET request fails when requesting a https page over a https proxy.

```
>>> import requests
>>> import os
>>> os.getenv("HTTPS_PROXY")
'https://localhost:3130'
>>> requests.get("https://example.org", verify = False)
Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 588, in urlopen
    self._prepare_proxy(conn)
  File "/usr/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 801, in _prepare_proxy
    conn.connect()
  File "/usr/lib/python3.5/site-packages/requests/packages/urllib3/connection.py", line 291, in connect
    self._tunnel()
  File "/usr/lib/python3.5/http/client.py", line 827, in _tunnel
    (version, code, message) = response._read_status()
  File "/usr/lib/python3.5/http/client.py", line 258, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/usr/lib/python3.5/socket.py", line 575, in readinto
    return self._sock.recv_into(b)
ConnectionResetError: [Errno 104] Connection reset by peer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/requests/adapters.py", line 423, in send
    timeout=timeout
  File "/usr/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 643, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/lib/python3.5/site-packages/requests/packages/urllib3/util/retry.py", line 363, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
requests.packages.urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='example.org', port=443): Max retries exceeded with url: / (Caused by ProxyError('Cannot connect to proxy.', ConnectionResetError(104, 'Connection reset by peer')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.5/site-packages/requests/api.py", line 70, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/lib/python3.5/site-packages/requests/api.py", line 56, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3.5/site-packages/requests/sessions.py", line 488, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python3.5/site-packages/requests/sessions.py", line 609, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python3.5/site-packages/requests/adapters.py", line 485, in send
    raise ProxyError(e, request=request)
requests.exceptions.ProxyError: HTTPSConnectionPool(host='example.org', port=443): Max retries exceeded with url: / (Caused by ProxyError('Cannot connect to proxy.', ConnectionResetError(104, 'Connection reset by peer')))
```

The proxy is the squid proxy with this configuration directive:
```
https_port 3130 cert=/etc/sqiud/ssl/squid.pem key=/etc/squid/ssl/squid.key
```

And this works OK:
```
curl --proxy https://localhost:3130 --proxy-insecure https://example.com
```


Requests does not really support connecting to proxies over HTTPS. In particular, we try to tunnel through them, and that just causes everything to go wrong. I'm afraid that until such time as someone improves httplib's support for this, or until we replace httplib, this is a use-case we simply cannot support.

how about this? http://code.activestate.com/recipes/456195/

We can make requests *to* HTTPS targets through a proxy, but we only support doing so when we've connected to the proxy over plaintext. That is, you must not make a TLS connection to the proxy itself.