danday74 danday74 - 1 month ago 6
Apache Configuration Question

Apache SSLPassPhraseDialog how to use environment variable in pass phrase script

I am using httpd

I am using SSLPassPhraseDialog in my apache conf file ...
(because my cert key has a passphrase and I don't want to remove it)

SSLPassPhraseDialog exec:${PathToSSLPassPhraseDialogScript}

The script it is pointing to looks like this ..

echo "mypassphrase";

This works!

BUT I want to store the passphrase in an environment variable.
When I do to this ...

export myenvvar="mypassphrase";

and change the script file to ...

echo "${myenvvar}";

it doesn't work.

I believe because the env var isn't visible when Apache runs the script.
(even though when I run the script directly it echos the env var).

Any way around this that uses environment variables?

I don't want to hardcode the password in a file. I also don't want to generate a file with the password hardcoded in it.

If I could somehow pass an argument to the script i think I could fix this BUT I've tried that and Apache won't let you pass args to SSLPassPhraseDialog.



My solution became, do not use Apache! Loving NGINX