Keep SSL keyfile open in Python
-
01-10-2019 - |
Question
I'm using Python's ssl
library with an encrypted keyfile. However every time I wrap a socket, I'm prompted for the passphrase.
Enter PEM pass phrase:
How can I give the passphrase just once, and have Python hold the decrypted key open for the lifetime of the process?
I'm very interested in the canonical openssl command line or C equivalent for this functionality also (assuming it assists in this situation).
I'd rather not resort to using subprocess
and explicitly decoding/deleting the decrypted key. However if there is no alternative, a clean, secure suggestion guaranteeing the destruction and privacy of the decrypted key is welcome.
Solution
This issue is fixed in Python 2.7, and Python 3.2.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow