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

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -