3

I need to automate X509 SSL certificate generation in a bash script (without prompt any strings to console).

I generate an SSL key and cert request automatically, but I can not automatize certificate generation without promt password.

This commands works without prompt:

openssl genrsa -des3 -passout pass:passwd -out testem/2.key 1024

openssl req -new -passin pass:passwd -subj "/" -key testem/2.key -out testem/2.csr

This command requests input password:

openssl x509 -req -days 365 -in testem/2.csr -signkey testem/2.key -out testem/2.crt

I can't find the option "-passout" in the manual of the command "x509".

What can be done?

Jakub Kotowski
  • 7,411
  • 29
  • 38
Daniyal
  • 129
  • 2
  • 9
  • possible duplicate of [How to build a self-signed certificate with openssl?](http://stackoverflow.com/questions/10175812/how-to-build-a-self-signed-certificate-with-openssl) – jww Feb 07 '14 at 07:41

1 Answers1

5

You need to supply the password. Like this for example.

openssl x509 -passin pass:passwd -req -days 365 -in testem/2.csr -signkey testem/2.key -out testem/2.crt
Martin
  • 911
  • 7
  • 21