Python SSL with PKCS # 12 certificates

Is there a way to associate a socket connection with SSL using the python ssl module in python 2.6 using the pkcs # 12 file? The file contains the private key and certificate. I want to use them for the client side of the connection. This post seems to hint that this is possible, but does not provide a real definitive answer.

+4
source share
1 answer

Not with python ssl module. M2Crypto cannot do this at the moment, nor python-gnutls. If your client computer has an openssl command, you can re-export this pkcs12 format to pem using the openssl command and use the results, for example:

openssl pkcs12 -in your_pkcs.p12 -out client_certs.pem -clcerts -nokeys [password options] openssl pkcs12 -in your_pkcs.p12 -out keys.pem -nocerts [password options] 

However, PKCS12 is completely upset by design , although it is still popular, you should avoid it if possible.

+2
source

All Articles