title: Verifying HTTPS certificates with urllib.request
body: <p>I am trying to open an https URL using the <a href="https://docs.python.org/3.2/library/urllib.request.html#urllib.request.urlopen" rel="noreferrer"><code>urlopen</code></a> method in Python 3's <a href="https://docs.python.org/3.2/library/urllib.request.html" rel="noreferrer"><code>urllib.request</code></a> module. It seems to work fine, but the documentation warns that "[i]f neither <code>cafile</code> nor <code>capath</code> is specified, an HTTPS request will not do any verification of the server’s certificate".</p>
  
  <p>I am guessing I need to specify one of those parameters if I don't want my program to be vulnerable to man-in-the-middle attacks, problems with revoked certificates, and other vulnerabilities.</p>
  
  <p><code>cafile</code> and <code>capath</code> are supposed to point to a list of certificates. Where am I supposed to get this list from? Is there any simple and cross-platform way to use the same list of certificates that my OS or browser uses?</p>