title: Python throwing an SSL certificate validation error w/o consulting system CA bundles?
body: <p>With two largely identical systems (both running Fedora 25, both with similar package versions installed), one system is failing with an SSL certicate verification error while another is not.  That is, if I run:</p>
  
  <pre><code>import requests
  r = requests.get('https://insidehost.corp.example.com')
  </code></pre>
  
  <p>One one system it works, while on the other it fails:</p>
  
  <pre><code>requests.exceptions.SSLError: ("bad handshake: Error([('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed')],)",)
  </code></pre>
  
  <p>At first I figure that I was simply missing the necessary CA certificates, but running python under <code>strace</code> reveals that on the failing system, python is <em>never attempting to open a ca bundle</em>.  That is, on the system that works:</p>
  
  <pre><code>strace -e trace=open,stat python testscript.py |&amp; grep /etc/pki
  </code></pre>
  
  <p>Yields only:</p>
  
  <pre><code>open("/etc/pki/tls/legacy-settings", O_RDONLY) = -1 ENOENT (No such file or directory)
  stat("/etc/pki/tls/certs/ca-bundle.crt", {st_mode=S_IFREG|0444, st_size=257079, ...}) = 0
  open("/etc/pki/tls/certs/ca-bundle.crt", O_RDONLY) = 4
  </code></pre>
  
  <p>But on the failing system yields:</p>
  
  <pre><code>open("/etc/pki/tls/legacy-settings", O_RDONLY) = -1 ENOENT (No such file or directory)
  </code></pre>
  
  <p>Furthermore, running the same test script with <code>python3</code> on the failing system...works!</p>
  
  <p>In both cases, <code>python</code> is <code>/usr/bin/python</code> from <code>python-2.7.13-1.fc25.x86_64</code>.  Neither system is setting any <code>*_CA_BUNDLE</code> environment variable.</p>