def https_open(self, req):
    return self.do_open(self.getConnection, req)

def getConnection(self, host, timeout=300):
    return httplib.HTTPSConnection(host, key_file=self.key, cert_file=self.cert
        )
opener = urllib.request.build_opener(HTTPSClientAuthHandler('/path/to/file.pem',
    '/path/to/file.pem.'))
response = opener.open('https://example.org')
print(response.read())
Использование парных сертификатов с urllib2