You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
425 B
Plaintext

9 years ago
#!/usr/bin/env bash
BASEDIR=$(realpath $(dirname $0));
KEYDIR=$(realpath "$BASEDIR/../storage/ca/");
9 years ago
if [ -f "$KEYDIR/ca.key" ]; then
9 years ago
echo "CA key already exists. not overwriting it."
exit 1;
fi
CN="ob.ae-cn";
if [ ! -z "$1" ]; then
9 years ago
CN="$1";
9 years ago
fi;
9 years ago
openssl req -days 3650 -nodes -new -x509 -keyout "$KEYDIR/ca.key" -out "$KEYDIR/ca.crt" -subj "/CN=$CN" -extensions ca_ext -config "$BASEDIR/../etc/openssl.conf";