浏览代码

[ACME] Add 0 byte check for cert.pem

andryyy 6 年之前
父节点
当前提交
60fd955def
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      data/Dockerfiles/acme/docker-entrypoint.sh
  2. 1 1
      docker-compose.yml

+ 1 - 1
data/Dockerfiles/acme/docker-entrypoint.sh

@@ -149,7 +149,7 @@ verify_challenge_path(){
 
 [[ ! -f ${ACME_BASE}/dhparams.pem ]] && cp ${SSL_EXAMPLE}/dhparams.pem ${ACME_BASE}/dhparams.pem
 
-if [[ -f ${ACME_BASE}/cert.pem ]] && [[ -f ${ACME_BASE}/key.pem ]]; then
+if [[ -f ${ACME_BASE}/cert.pem ]] && [[ -f ${ACME_BASE}/key.pem ]] && [[ $(stat -c%s ${ACME_BASE}/cert.pem) != 0 ]]; then
   ISSUER=$(openssl x509 -in ${ACME_BASE}/cert.pem -noout -issuer)
   if [[ ${ISSUER} != *"Let's Encrypt"* && ${ISSUER} != *"mailcow"* && ${ISSUER} != *"Fake LE Intermediate"* ]]; then
     log_f "Found certificate with issuer other than mailcow snake-oil CA and Let's Encrypt, skipping ACME client..."

+ 1 - 1
docker-compose.yml

@@ -307,7 +307,7 @@ services:
     acme-mailcow:
       depends_on:
         - nginx-mailcow
-      image: mailcow/acme:1.52
+      image: mailcow/acme:1.53
       build: ./data/Dockerfiles/acme
       dns:
         - ${IPV4_NETWORK:-172.22.1}.254