Commit 74e6a1c3 authored by Raymond Kristiansen's avatar Raymond Kristiansen
Browse files

Updated cert generation script to run with batch

parent fb7ce75d
...@@ -11,15 +11,27 @@ cnf="cnf/${host}.cnf" ...@@ -11,15 +11,27 @@ cnf="cnf/${host}.cnf"
if [ -f "cnf/${host}.cnf" ]; then if [ -f "cnf/${host}.cnf" ]; then
cnf="cnf/${host}.cnf" cnf="cnf/${host}.cnf"
else else
cnf="intermediate/openssl.cnf" echo "[ req ]
default_bits = 2048
prompt = no
encrypt_key = no
default_md = sha256
distinguished_name = dn
utf8 = yes
[ dn ]
C = NO
O = My Org
CN = ${host}
" > cnf/${host}.cnf
cnf="cnf/${host}.cnf"
fi fi
echo "Using ${cnf} as config file" echo "Using ${cnf} as config file"
openssl genrsa -out intermediate/private/${host}.key.pem 2048 openssl genrsa -out intermediate/private/${host}.key.pem 2048
openssl req -config ${cnf} -batch -key intermediate/private/${host}.key.pem -new -sha256 -out intermediate/csr/${host}.csr.pem
openssl req -config ${cnf} -key intermediate/private/${host}.key.pem -new -sha256 -out intermediate/csr/${host}.csr.pem
openssl ca -config intermediate/openssl.cnf -extensions v3_req \ openssl ca -config intermediate/openssl.cnf -extensions v3_req \
-days 375 -notext -md sha256 -in intermediate/csr/${host}.csr.pem \ -days 375 -notext -md sha256 -in intermediate/csr/${host}.csr.pem \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment