summaryrefslogtreecommitdiffstats
path: root/conf/CA/bootstrap.sh
diff options
context:
space:
mode:
Diffstat (limited to 'conf/CA/bootstrap.sh')
-rw-r--r--conf/CA/bootstrap.sh16
1 files changed, 9 insertions, 7 deletions
diff --git a/conf/CA/bootstrap.sh b/conf/CA/bootstrap.sh
index bf946782..6ccc6bfa 100644
--- a/conf/CA/bootstrap.sh
+++ b/conf/CA/bootstrap.sh
@@ -32,7 +32,8 @@ if [ ! -e ./serial ]; then
fi
NAME=aaf.bootstrap
-FQDN="${HOSTNAME:=$(hostname -f)}"
+HOSTNAME="${HOSTNAME:=$(hostname -)}"
+FQDN="${aaf_locator_fqdn:=$HOSTNAME}"
FQI=aaf@aaf.osaaf.org
SUBJECT="/CN=$FQDN/OU=$FQI`cat subject.aaf`"
SIGNER_P12=$1
@@ -141,14 +142,15 @@ $PASSPHRASE
EOF
# Make Issuer name
-ISSUER=$(openssl x509 -subject -noout -in $SIGNER_CRT | cut -c 10-)
-for I in ${ISSUER//\// }; do
- if [ -n "$CADI_X509_ISSUER" ]; then
- CADI_X509_ISSUER=", $CADI_X509_ISSUER"
+ISSUER=$(openssl x509 -subject -noout -in $SIGNER_CRT | cut -c 9- | sed -e 's/ = /=/g' -e 's/\//, /g')
+for I in $ISSUER; do
+ if [ -z "$REVERSE" ]; then
+ REVERSE="${I%,}"
+ else
+ REVERSE="${I%,}, ${REVERSE}"
fi
- CADI_X509_ISSUER="$I$CADI_X509_ISSUER"
done
-echo $CADI_X509_ISSUER > $BOOTSTRAP_ISSUER
+echo "$REVERSE" > $BOOTSTRAP_ISSUER
# Cleanup
rm -f $BOOTSTRAP_SAN $BOOTSTRAP_KEY $BOOTSTRAP_CSR $BOOTSTRAP_CRT $SIGNER_KEY $SIGNER_CRT $BOOTSTRAP_CHAIN