From 962c8003312ff2f026e5855e536b3073062e0f01 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 22 Sep 2017 15:48:42 +0100 Subject: better error handling in httpd-ssl-gencerts (#1494556) Resolves: rhbz#1494556 --- httpd-ssl-gencerts | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'httpd-ssl-gencerts') diff --git a/httpd-ssl-gencerts b/httpd-ssl-gencerts index 22aece4..350f5b5 100755 --- a/httpd-ssl-gencerts +++ b/httpd-ssl-gencerts @@ -3,6 +3,7 @@ set -e FQDN=`hostname` +ssldotconf=/etc/httpd/conf.d/ssl.conf if test -f /etc/pki/tls/certs/localhost.crt -a \ -f /etc/pki/tls/private/localhost.key; then @@ -21,6 +22,12 @@ if test ! -f /etc/pki/tls/certs/localhost.crt -a \ exit 1 fi +if ! test -f ${ssldotconf} || \ + ! grep -q '^SSLCertificateFile /etc/pki/tls/certs/localhost.crt' ${ssldotconf} || \ + ! grep -q '^SSLCertificateKeyFile /etc/pki/tls/private/localhost.key' ${ssldotconf}; then + # Non-default configuration, do nothing. + exit 0 +fi sscg -q \ --cert-file /etc/pki/tls/certs/localhost.crt \ -- cgit