title: SSLError using Requests and Python 3.6
body: <p>I'm getting an <code>SSLError</code> while submitting a request against <code>https://myaccount.xcelenergy.com</code> (and am not nearly enough of an SSL expert to understand why). Can you help me see what the issue is (and how to address it)?</p>
  
  <p><strong>Environment</strong></p>
  
  <ul>
  <li>macOS 10.13.2</li>
  <li>LibreSSL 2.2.7 (installed via <a href="https://brew.sh/" rel="nofollow noreferrer">Homebrew</a>)</li>
  <li>Python 3.6.4 (installed via <a href="https://brew.sh/" rel="nofollow noreferrer">Homebrew</a>)</li>
  <li>Requests 2.18.4 (installed via <a href="https://github.com/pypa/pipenv" rel="nofollow noreferrer">pipenv</a>)</li>
  <li>Certifi 2017.11.5 (installed via <a href="https://github.com/pypa/pipenv" rel="nofollow noreferrer">pipenv</a>)</li>
  </ul>
  
  <p><strong>Code</strong></p>
  
  <pre><code>import requests
  
  requests.get('https://myaccount.xcelenergy.com')
  </code></pre>
  
  <p><strong>Stacktrace</strong></p>
  
  <pre><code>Traceback (most recent call last):
    File "/Users/abach/.local/share/virtualenvs/pyxcel-PG9DCiyE/lib/python3.6/site-packages/urllib3/connectionpool.py", line 595, in urlopen
      self._prepare_proxy(conn)
    File "/Users/abach/.local/share/virtualenvs/pyxcel-PG9DCiyE/lib/python3.6/site-packages/urllib3/connectionpool.py", line 816, in _prepare_proxy
      conn.connect()
    File "/Users/abach/.local/share/virtualenvs/pyxcel-PG9DCiyE/lib/python3.6/site-packages/urllib3/connection.py", line 326, in connect
      ssl_context=context)
    File "/Users/abach/.local/share/virtualenvs/pyxcel-PG9DCiyE/lib/python3.6/site-packages/urllib3/util/ssl_.py", line 329, in ssl_wrap_socket
      return context.wrap_socket(sock, server_hostname=server_hostname)
    File "/usr/local/Cellar/python3/3.6.4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 407, in wrap_socket
      _context=self, _session=session)
    File "/usr/local/Cellar/python3/3.6.4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 814, in __init__
      self.do_handshake()
    File "/usr/local/Cellar/python3/3.6.4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 1068, in do_handshake
      self._sslobj.do_handshake()
    File "/usr/local/Cellar/python3/3.6.4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 689, in do_handshake
      self._sslobj.do_handshake()
  ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "/Users/abach/.local/share/virtualenvs/pyxcel-PG9DCiyE/lib/python3.6/site-packages/requests/adapters.py", line 440, in send
      timeout=timeout
    File "/Users/abach/.local/share/virtualenvs/pyxcel-PG9DCiyE/lib/python3.6/site-packages/urllib3/connectionpool.py", line 639, in urlopen
      _stacktrace=sys.exc_info()[2])
    File "/Users/abach/.local/share/virtualenvs/pyxcel-PG9DCiyE/lib/python3.6/site-packages/urllib3/util/retry.py", line 388, in increment
      raise MaxRetryError(_pool, url, error or ResponseError(cause))
  urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='myaccount.xcelenergy.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)'),))
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "/Users/abach/.local/share/virtualenvs/pyxcel-PG9DCiyE/lib/python3.6/site-packages/requests/api.py", line 72, in get
      return request('get', url, params=params, **kwargs)
    File "/Users/abach/.local/share/virtualenvs/pyxcel-PG9DCiyE/lib/python3.6/site-packages/requests/api.py", line 58, in request
      return session.request(method=method, url=url, **kwargs)
    File "/Users/abach/.local/share/virtualenvs/pyxcel-PG9DCiyE/lib/python3.6/site-packages/requests/sessions.py", line 508, in request
      resp = self.send(prep, **send_kwargs)
    File "/Users/abach/.local/share/virtualenvs/pyxcel-PG9DCiyE/lib/python3.6/site-packages/requests/sessions.py", line 618, in send
      r = adapter.send(request, **kwargs)
    File "/Users/abach/.local/share/virtualenvs/pyxcel-PG9DCiyE/lib/python3.6/site-packages/requests/adapters.py", line 506, in send
      raise SSLError(e, request=request)
  requests.exceptions.SSLError: HTTPSConnectionPool(host='myaccount.xcelenergy.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)'),))
  </code></pre>
  
  <p><strong>What I've Tried (to no avail)</strong></p>
  
  <pre><code># Specifically calling out local cert chain:
  requests.get('https://myaccount.xcelenergy.com', verify='/usr/local/etc/openssl/cert.pem')
  
  # Using Certifi's old chain:
  requests.get('https://myaccount.xcelenergy.com', verify=certifi.old_where())
  </code></pre>