I'm using Fabric to automate SSL creation, but when I run something like
local('openssl genrsa -out /etc/ssl/'+hostname+'/'+hostname+'.key 2048')
it prompts me for country, state, an email address, etc. Is there anything I can do (possibly with an openssl.cnf?) to prevent the need for user input with those prompts, or do people usually just hack it using something like pexpect?
Update:
If I put prompt=no
in my openssl.cnf, cd
to /ssdhome/development/server
, then run:
sudo openssl req -new -key './server.key' -out './server.csr' -config='./openssl.cnf'
openssl prints out help
information instead of running the above command. Where have I gone wrong?
Update 2: -config should not have an '=' sign, but a space. Solved. Also linked to this copy of my openssl.cnf to get it working: