@@ -99,7 +99,7 @@ function process_extending_config_files() {
99
99
done <<< " $(get_matched_files " $custom_dir " " $default_dir " '*.conf' | sort -u)"
100
100
}
101
101
102
- # Copy config files from application to the location where httd expects them
102
+ # Copy config files from application to the location where httpd expects them
103
103
# Param sets the directory where to look for files
104
104
# This function was taken from httpd container
105
105
process_config_files () {
@@ -119,16 +119,22 @@ process_ssl_certs() {
119
119
local dir=${1:- .}
120
120
if [ -d ${dir} /httpd-ssl/private ] && [ -d ${dir} /httpd-ssl/certs ]; then
121
121
echo " ---> Looking for SSL certs for httpd..."
122
- cp -r ${dir} /httpd-ssl ${APP_ROOT}
123
- local ssl_cert=" $( ls -A ${APP_ROOT} /httpd-ssl/certs/* .pem | head -n 1) "
124
- local ssl_private=" $( ls -A ${APP_ROOT} /httpd-ssl/private/* .pem | head -n 1) "
125
- if [ -f " ${ssl_cert} " ] && [ -f " ${ssl_private} " ]; then
126
- echo " ---> Setting SSL certs for httpd..."
122
+ cp -r ${dir} /httpd-ssl ${HTTPD_APP_ROOT}
123
+ local ssl_cert=" $( ls -A ${HTTPD_APP_ROOT} /httpd-ssl/certs/* .pem | head -n 1) "
124
+ local ssl_private=" $( ls -A ${HTTPD_APP_ROOT} /httpd-ssl/private/* .pem | head -n 1) "
125
+ if [ -f " ${ssl_cert} " ] ; then
126
+ # do sed for SSLCertificateFile and SSLCertificateKeyFile
127
+ echo " ---> Setting SSL cert file for httpd..."
127
128
sed -i -e " s|^SSLCertificateFile .*$|SSLCertificateFile ${ssl_cert} |" ${HTTPD_MAIN_CONF_D_PATH} /ssl.conf
128
- sed -i -e " s|^SSLCertificateKeyFile .*$|SSLCertificateKeyFile ${ssl_private} |" ${HTTPD_MAIN_CONF_D_PATH} /ssl.conf
129
+ if [ -f " ${ssl_private} " ]; then
130
+ echo " ---> Setting SSL key file for httpd..."
131
+ sed -i -e " s|^SSLCertificateKeyFile .*$|SSLCertificateKeyFile ${ssl_private} |" ${HTTPD_MAIN_CONF_D_PATH} /ssl.conf
132
+ else
133
+ echo " ---> Removing SSL key file settings for httpd..."
134
+ sed -i ' /^SSLCertificateKeyFile .*/d' ${HTTPD_MAIN_CONF_D_PATH} /ssl.conf
135
+ fi
129
136
fi
130
137
rm -rf ${dir} /httpd-ssl
131
138
fi
132
139
}
133
140
134
-
0 commit comments