generate-self-signed-cert: Generalize to CentOS, Fedora, RHEL.

This commit is contained in:
rht 2019-01-05 01:09:16 +00:00 committed by Tim Abbott
parent efc1c74792
commit a55f5b59f6
1 changed files with 14 additions and 3 deletions

View File

@ -30,8 +30,15 @@ fi
set -x
KEYFILE=/etc/ssl/private/zulip.key
CERTFILE=/etc/ssl/certs/zulip.combined-chain.crt
is_redhat=false
if [ -e /etc/redhat-release ]; then
is_redhat=true
SSLDIR=/etc/pki/tls
else
SSLDIR=/etc/ssl
fi
KEYFILE=$SSLDIR/private/zulip.key
CERTFILE=$SSLDIR/certs/zulip.combined-chain.crt
if [ -n "$EXISTS_OK" ] && [ -e "$KEYFILE" ] && [ -e "$CERTFILE" ]; then
exit 0
@ -68,7 +75,11 @@ basicConstraints = CA:FALSE
subjectAltName = DNS:$EXTERNAL_HOST
EOF
apt-get install -y openssl
if [ "$is_redhat" = true ]; then
yum install -y openssl
else
apt-get install -y openssl
fi
# Based on /usr/sbin/make-ssl-cert from Debian's `ssl-cert` package.
openssl req -new -x509 \