Providing passphrase to socat OpenSSL target with encrypted private key

94 Views Asked by At

I am trying to connect various data sources to an HTTPS (TLS 1.2) target using socat.

The target requires me to use a client certificate, and I have been provided an encrypted private key to go with it.

However, I can't figure out a good way to pass the passphrase to socat:

$ socat PIPE OPENSSL:target.dev:443,cafile=cafile.pem,key=key.pem,certificate=key.pem
Enter PEM pass phrase:

I need this to be non-interactive, and ideally I'd like it if the passphrase is never persisted to a file in the filesystem.

I also don't want to decrypt the private key and keep that on disk.

Basically, I'd like to figure out a good and safe way to pass the passphrase to socat via stdin.

Any ideas?

0

There are 0 best solutions below