Use pem cert if it's available

This commit is contained in:
Bob Mottram 2016-10-29 14:05:35 +01:00
parent aa5c5328c8
commit afb0a46fc8
1 changed files with 5 additions and 1 deletions

View File

@ -121,7 +121,11 @@ function nginx_ssl {
echo ' ssl_stapling off;' >> $filename echo ' ssl_stapling off;' >> $filename
echo ' ssl_stapling_verify off;' >> $filename echo ' ssl_stapling_verify off;' >> $filename
echo ' ssl on;' >> $filename echo ' ssl on;' >> $filename
echo " ssl_certificate /etc/ssl/certs/${domain_name}.crt;" >> $filename if [ -f /etc/ssl/certs/${domain_name}.pem ]; then
echo " ssl_certificate /etc/ssl/certs/${domain_name}.pem;" >> $filename
else
echo " ssl_certificate /etc/ssl/certs/${domain_name}.crt;" >> $filename
fi
echo " ssl_certificate_key /etc/ssl/private/${domain_name}.key;" >> $filename echo " ssl_certificate_key /etc/ssl/private/${domain_name}.key;" >> $filename
echo " ssl_dhparam /etc/ssl/certs/${domain_name}.dhparam;" >> $filename echo " ssl_dhparam /etc/ssl/certs/${domain_name}.dhparam;" >> $filename
echo '' >> $filename echo '' >> $filename