diff --git a/context/base/docker-entrypoint.d/20-certs.sh b/context/base/docker-entrypoint.d/20-certs.sh index 8ba681d..e4ae0f5 100755 --- a/context/base/docker-entrypoint.d/20-certs.sh +++ b/context/base/docker-entrypoint.d/20-certs.sh @@ -7,15 +7,16 @@ CERT_KEY="/cert/${FIRST_VIRTUAL_HOST:-localhost}.key" CA_CERT="/rootCA/rootCA.pem" CA_KEY="/rootCA/rootCA-key.pem" -IP_ADDRESS=$(hostname -i) -export IP_ADDRESS - envsubst /tmp/cert.cfg for host in ${VIRTUAL_HOST:-localhost}; do echo "dns_name = $host" >>/tmp/cert.cfg done +for ip_address in $(hostname -i); do + echo "ip_address = $ip_address" >>/tmp/cert.cfg +done + certtool --generate-privkey --outfile "${CERT_KEY}" if [ ! -r "${CA_CERT}" ] || [ ! -r "${CA_KEY}" ]; then diff --git a/context/base/etc/https-proxy/cert.cfg.template b/context/base/etc/https-proxy/cert.cfg.template index c5b03d7..992ce41 100644 --- a/context/base/etc/https-proxy/cert.cfg.template +++ b/context/base/etc/https-proxy/cert.cfg.template @@ -2,4 +2,3 @@ organization = "Development certificate" unit = "${HOSTNAME}" cn = "${FIRST_VIRTUAL_HOST}" expiration_days = ${EXPIRATION_DAYS} -ip_address = "${IP_ADDRESS}"