m2crypto loading cert file from memory buffer

N

netpork

started using m2crypto recently, it works pretty well by now, i just
have one question:

ctx = SSL.Context('sslv3')
ctx.load_cert_chain('client.pem')

anyone knows a way of loading cert file from memory buffer and not
from a file?
i just do not want to have my cert file in the directory of my app
that anyone can get.
 
H

Heikki Toivonen

netpork said:
ctx = SSL.Context('sslv3')
ctx.load_cert_chain('client.pem')

anyone knows a way of loading cert file from memory buffer and not
from a file?

Yeah, see for example how I did it for Chandler:
http://svn.osafoundation.org/chandler/trunk/chandler/parcels/osaf/framework/certstore/ssl.py
(the loadCertificatesToContext function). You just need an SSL.Context,
get_cert_store() from it, and call the store's add_x509() for each cert.
i just do not want to have my cert file in the directory of my app
that anyone can get.

Typically certificates are public, for example all of your peers will
get the certificate anyway, so I don't see this as a problem. Your
private key is what you want to protect. Just make sure it is not
concatenated to your certificate file and there would probably be no
problem leaving the cert file publicly available.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top