Verify certificate with Python
<p>I'm trying to write a script in Python to download PDFs. It works fine except when I want to access my university's pages which need a certificate.</p>

<p>My question is: how do I "show" the page that I have the correct certificate before I download? My code looks like this:</p>

<pre><code>import urllib

def downloadPDF(url):
    webFile = urllib.urlopen(url)
    localFile = open("myPDF.pdf", "wb")
    localFile.write(webFile.read())
    webFile.close()
    localFile.close()
</code></pre>

<p>So, when after I try to use <code>urllib.urlopen(url)</code>, I would guess that I need something to tell the system that I have the correct certificate. What is the best way to do this? Thanks!</p>
