mellon_create_metadata.sh: Use hostname as CN during metadata creation.

git-svn-id: https://modmellon.googlecode.com/svn/trunk@91 a716ebb1-153a-0410-b759-cfb97c6a1b53
This commit is contained in:
olavmrk 2010-06-17 07:17:51 +00:00
parent 00b49dd4bd
commit f43eb9a317
1 changed files with 3 additions and 1 deletions

View File

@ -33,6 +33,7 @@ if ! echo "$BASEURL" | grep -q '^https\?://'; then
exit 1
fi
HOST="$(echo "$BASEURL" | sed 's#^[a-z]*://\([^/]*\).*#\1#')"
BASEURL="$(echo "$BASEURL" | sed 's#/$##')"
OUTFILE="$(echo "$ENTITYID" | sed 's/[^A-Za-z.]/_/g' | sed 's/__*/_/g')"
@ -40,6 +41,7 @@ echo "Output files:"
echo "Private key: $OUTFILE.key"
echo "Certificate: $OUTFILE.cert"
echo "Metadata: $OUTFILE.xml"
echo "Host: $HOST"
echo
echo "Endpoints:"
echo "SingleLogoutService: $BASEURL/logout"
@ -60,7 +62,7 @@ distinguished_name = req_distinguished_name
prompt = no
policy = policy_anything
[req_distinguished_name]
commonName = $ENTITYID
commonName = $HOST
EOF
openssl req -utf8 -batch -config "$TEMPLATEFILE" -new -x509 -days 3652 -nodes -out "$OUTFILE.cert" -keyout "$OUTFILE.key" 2>/dev/null