title: Python Requests - How to use system ca-certificates (debian/ubuntu)?
body: <p>I've installed a self-signed root ca cert into debian's <code>/usr/share/ca-certificates/local</code> and installed them with <code>sudo dpkg-reconfigure ca-certificates</code>. At this point <code>true | gnutls-cli mysite.local</code> is happy, and <code>true | openssl s_client -connect mysite.local:443</code> is happy, but python2 and python3 requests module insists it is not happy with the cert.</p>
  
  <p>python2:</p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;string&gt;", line 1, in &lt;module&gt;
    File "/usr/local/lib/python2.7/site-packages/requests/api.py", line 70, in get
      return request('get', url, params=params, **kwargs)
    File "/usr/local/lib/python2.7/site-packages/requests/api.py", line 56, in request
      return session.request(method=method, url=url, **kwargs)
    File "/usr/local/lib/python2.7/site-packages/requests/sessions.py", line 488, in request
      resp = self.send(prep, **send_kwargs)
    File "/usr/local/lib/python2.7/site-packages/requests/sessions.py", line 609, in send
      r = adapter.send(request, **kwargs)
    File "/usr/local/lib/python2.7/site-packages/requests/adapters.py", line 497, in send
      raise SSLError(e, request=request)
  requests.exceptions.SSLError: ("bad handshake: Error([('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')],)",)
  </code></pre>
  
  <p>python3</p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;string&gt;", line 1, in &lt;module&gt;
    File "/usr/local/bin/python3.5/site-packages/requests/api.py", line 70, in get
      return request('get', url, params=params, **kwargs)
    File "/usr/local/bin/python3.5/site-packages/requests/api.py", line 56, in request
      return session.request(method=method, url=url, **kwargs)
    File "/usr/local/bin/python3.5/site-packages/requests/sessions.py", line 488, in request
      resp = self.send(prep, **send_kwargs)
    File "/usr/local/bin/python3.5/site-packages/requests/sessions.py", line 609, in send
      r = adapter.send(request, **kwargs)
    File "/usr/local/bin/python3.5/site-packages/requests/adapters.py", line 497, in send
      raise SSLError(e, request=request)
  requests.exceptions.SSLError: ("bad handshake: Error([('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')],)",)
  </code></pre>
  
  <h3>Why does python ignore the system ca-certificates bundle, and how do I integrate it?</h3>