CentOS 8: work around mod_ssl certificate issue

CentOS 8 has an issue with mod_ssl which produces an invalid Apache
configuration in /etc/httpd/conf.d/ssl.conf. This causes the following
error on startup:

SSLCertificateFile: file '/etc/pki/tls/certs/localhost.crt' does not exist or is empty

Work around this by generating certificates manually.

Partially-Implements: blueprint centos-rhel-8

Change-Id: Id8bcefa3527575ba72fe37013787ba716e435ac8
This commit is contained in:
Mark Goddard 2019-12-11 10:59:47 +00:00 committed by Marcin Juszkiewicz
parent e18bd08e75
commit 3590188383
1 changed files with 9 additions and 0 deletions

View File

@ -15,4 +15,13 @@ if [[ "$(whoami)" == 'root' ]]; then
else
rm -rf /var/run/httpd/* /run/httpd/* /tmp/httpd*
fi
# CentOS 8 has an issue with mod_ssl which produces an invalid Apache
# configuration in /etc/httpd/conf.d/ssl.conf. This causes the following error
# on startup:
# SSLCertificateFile: file '/etc/pki/tls/certs/localhost.crt' does not exist or is empty
# Work around this by generating certificates manually.
if [[ ${KOLLA_BASE_DISTRO} = centos ]] && [[ ! -e /etc/pki/tls/certs/localhost.crt ]]; then
/usr/libexec/httpd-ssl-gencerts
fi
fi