14 lines
437 B
Bash
Executable File
14 lines
437 B
Bash
Executable File
#!/bin/bash
|
|
if [ "$1" = "" ]; then
|
|
echo 'Exit. Your must enter hostname (CN) !'
|
|
exit 1
|
|
fi
|
|
#cd /home/agm/ssl/
|
|
HOST_NAME="$1"
|
|
|
|
# Sign the certificate with the root CA
|
|
openssl x509 -req -days 7300 -in $HOST_NAME.csr -CA ./rootCA/rootCA.crt -CAkey ./rootCA/rootCA.key -CAcreateserial -out ./$HOST_NAME.crt -sha256 -extfile v3-ext.cnf
|
|
|
|
# Make pem file combining the key and certificate file
|
|
cat $HOST_NAME.key $HOST_NAME.crt > $HOST_NAME.pem
|