How to pass an x509 object to python's urllib2? -
i have p12 encrypted certificate open with:
p12cert = load_pkcs12(file("cert.p12", 'rb').read(), 'passwd')
so can keep certificate file stored encrypted , decrypt when loading. can access both certificate , key:
p12.get_certificate() p12.get_privatekey()
however, urllib2's httpsclientauthhandler requires fields passed files:
urllib2.build_opener(httpsclientauthhandler('/path/to/file.pem', '/path/to/file.pem.') )
this means i'd have write data unencrypted on temporary files, clear security hole. have idea on how overcome problem?
regards
Comments
Post a Comment