I want to silently, non interactively, create an SSL certificate. I.e., without get prompted for any data.
The normal way I create the certificate would be:
openssl req -x509 -nodes -days 7300 -newkey rsa:2048 \
-keyout /etc/ssl/private/pure-ftpd.pem -out /etc/ssl/private/pure-ftpd.pem
I tried the following:
openssl genrsa -out server.key 2048
touch openssl.cnf
cat >> openssl.cnf <<EOF
[ req ]
prompt = no
distinguished_name = req_distinguished_name
[ req_distinguished_name ]
C = GB
ST = Test State
L = Test Locality
O = Org Name
OU = Org Unit Name
CN = Common Name
emailAddress = [email protected]
EOF
openssl req -x509 -config openssl.cnf -nodes -days 7300 \
-signkey server.key -out /etc/ssl/private/pure-ftpd.pem
But I still get a prompt for data.
openssl req -x509 -config openssl.cnf -nodes -days 7300 -signkey server.key -out /etc/ssl/private/pure-ftpd.pem
-signkey
. This is not a validopenssl req
option on my system. The error message will have this as the very first line:unknown option -signkey
2> /dev/null
.