David Haller wrote:
Hello,
On Fri, 06 Feb 2009, David C. Rankin wrote:
No matter what I try, I can't automate:
openssl genrsa -des3 -out server.key 1024
I have tried:
TPHRASE=somekey openssl genrsa -des3 -out server.key 1024 <<GENPSK $TPHRASE $TPHRASE GENPSK
TPHRASE=somekey openssl genrsa -passout stdin -des3 -out server.key 1024 <<'GENPSK' $TPHRASE GENPSK
The passphrase is for the output file, which I found in the "usage" of the genrsa call.
HTH, -dnh
Got it! But, I had to get rid of the single quotes around the here doc tags. From man bash on here docs: <quote> If any characters in word are quoted, the delimiter is the result of quote removal on word, and the lines in the here-document are not expanded. </quote> So what was happening is that the passphrase for the genrsa was being set to '$TPHRASE' instead of 'somekey'. This caused problems with the line: openssl req -new -key server.key -out server.csr <<GENCSR $TPHRASE <snip> But I was able to get around that with: openssl req -new -key server.key -out server.csr -passin pass:$TPHRASE <<GENCSR $COUNTRY $STATE <snip> Now it all works! Thanks David. The finished script that automates the apache2 ssl setup on openSuSE is at: http://www.3111skyline.com/download/linux/scripts/apache-ssl-setup -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org