Enter PEM pass phrase just once

I have a loop that that run every 30 sec, connects to a SSL server (reactor.connectSSL()), send a message (self.transport.write(msg)) and then disconnect (self.transport.loseConnection()).

The issue is that it asks "Enter PEM pass phrase" each time the loop try to connect. Is it possible to enter it just once?

Answers


As suggested by Mikael, you can remove the pass phrase from the Key. Do note that this presents a serious security risk.

To remove the pass phrase from the Key, perform the following steps. Say you have a file called foo.pem with the following contents:

-----BEGIN ENCRYPTED PRIVATE KEY-----
...
-----END ENCRYPTED PRIVATE KEY-----
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----

Execute the following command:

openssl rsa -in foo.pem -out foo_unencrypted.pem

You will be prompted for the pass phrase, and in return receive a file foo_unencrypted.pem that contains the following:

-----BEGIN RSA PRIVATE KEY-----
...
-----END RSA PRIVATE KEY-----

This file is missing the BEGIN CERTIFICATE ---- END CERTIFICATE section from above, so copy-paste it from foo.pem to the end of foo_unencrypted.pem:

-----BEGIN RSA PRIVATE KEY-----
...
-----END RSA PRIVATE KEY-----
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----

If you use the file foo_unencrypted.pem, you will now no longer be prompted to "Enter PEM pass phrase".


I eventually found this post: Auto enter pass phrase in case of Python ssl Client/Server where they suggest that you remove the pass phrase from the Key.


Need Your Help

close a port with nodeJS

node.js

I am learning nodeJS. As I write a program that listen on a port, lets say 8081, and then write another program that listen on the same port I will get this type of error message:

Error "MSB3176: Specified minimum required version is greater than the current publish version"

c# msbuild .net-2.0 cruisecontrol.net

I've got build server running CruiseControl.NET and recently it started throwing this error on one of my projects (.NET 2.0, C#):