title: python-requests authenticated proxy httplib.BadStatusLine
body: <p>Authenticated proxy through python-requests returns the following error:</p>
  
  <pre><code>&gt;&gt;&gt; import requests
  &gt;&gt;&gt; proxies = {'https': 'http://username:password@proxy.company.com:8080',}
  &gt;&gt;&gt; requests.get('https://api.github.com/',proxies=proxies,verify=False)
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "/usr/lib/python2.6/site-packages/requests/api.py", line 55, in get
      return request('get', url, **kwargs)
    File "/usr/lib/python2.6/site-packages/requests/api.py", line 44, in request
      return session.request(method=method, url=url, **kwargs)
    File "/usr/lib/python2.6/site-packages/requests/sessions.py", line 335, in request
      resp = self.send(prep, **send_kwargs)
    File "/usr/lib/python2.6/site-packages/requests/sessions.py", line 438, in send
      r = adapter.send(request, **kwargs)
    File "/usr/lib/python2.6/site-packages/requests/adapters.py", line 327, in send
      raise ConnectionError(e)
  requests.exceptions.ConnectionError: HTTPConnectionPool(host='proxy.company.com', port=8080): Max retries exceeded with url: https://api.github.com/ (Caused by &lt;class 'httplib.BadStatusLine'&gt;: )
  </code></pre>
  
  <p>Authenticated proxy works fine in curl:</p>
  
  <pre><code>$ curl --proxy-user username:password --proxy http://proxy.company.com:8080 -k https://api.github.com/
  {
    "current_user_url": "https://api.github.com/user",
    "authorizations_url": "https://api.github.com/authorizations",
    "emails_url": "https://api.github.com/user/emails",
    "emojis_url": "https://api.github.com/emojis",
    "events_url": "https://api.github.com/events",
    "feeds_url": "https://api.github.com/feeds",
    "following_url": "https://api.github.com/user/following{/target}",
    "gists_url": "https://api.github.com/gists{/gist_id}",
    "hub_url": "https://api.github.com/hub",
    "issue_search_url": "https://api.github.com/legacy/issues/search/{owner}/{repo}/{state}/{keyword}",
    "issues_url": "https://api.github.com/issues",
    "keys_url": "https://api.github.com/user/keys",
    "notifications_url": "https://api.github.com/notifications",
    "organization_repositories_url": "https://api.github.com/orgs/{org}/repos/{?type,page,per_page,sort}",
    "organization_url": "https://api.github.com/orgs/{org}",
    "public_gists_url": "https://api.github.com/gists/public",
    "rate_limit_url": "https://api.github.com/rate_limit",
    "repository_url": "https://api.github.com/repos/{owner}/{repo}",
    "repository_search_url": "https://api.github.com/legacy/repos/search/{keyword}{?language,start_page}",
    "current_user_repositories_url": "https://api.github.com/user/repos{?type,page,per_page,sort}",
    "starred_url": "https://api.github.com/user/starred{/owner}{/repo}",
    "starred_gists_url": "https://api.github.com/gists/starred",
    "team_url": "https://api.github.com/teams",
    "user_url": "https://api.github.com/users/{user}",
    "user_organizations_url": "https://api.github.com/user/orgs",
    "user_repositories_url": "https://api.github.com/users/{user}/repos{?type,page,per_page,sort}",
    "user_search_url": "https://api.github.com/legacy/user/search/{keyword}"
  }
  </code></pre>
  
  <p>How do I troubleshoot?</p>