From bdb3e8057e46d5e69bae3dffb4d2669090b0ee8f Mon Sep 17 00:00:00 2001
From: Marius Burkard <m.burkard@pixcept.de>
Date: Fri, 22 Jan 2016 11:00:12 +0100
Subject: [PATCH] - fixed missing path in check

---
 server/plugins-available/apache2_plugin.inc.php | 2 +-
 server/plugins-available/nginx_plugin.inc.php   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/server/plugins-available/apache2_plugin.inc.php b/server/plugins-available/apache2_plugin.inc.php
index 6baa1d4d09..4a6437e924 100644
--- a/server/plugins-available/apache2_plugin.inc.php
+++ b/server/plugins-available/apache2_plugin.inc.php
@@ -1170,7 +1170,7 @@ class apache2_plugin {
 			if(!file_exists($crt_tmp_file) && !file_exists($key_tmp_file)) {
 				$app->log("Create Let's Encrypt SSL Cert for: $domain", LOGLEVEL_DEBUG);
 
-				if(is_dir($webroot . "/.well-known/")) {
+				if(is_dir($webroot . "/.well-known/acme-challenge/")) {
 					$app->log("Remove old challenge directory", LOGLEVEL_DEBUG);
 					$this->_exec("rm -rf " . $webroot . "/.well-known/acme-challenge/");
 				}
diff --git a/server/plugins-available/nginx_plugin.inc.php b/server/plugins-available/nginx_plugin.inc.php
index 9eb916bd70..f4c5f9d5ba 100644
--- a/server/plugins-available/nginx_plugin.inc.php
+++ b/server/plugins-available/nginx_plugin.inc.php
@@ -1290,7 +1290,7 @@ class nginx_plugin {
 			if(!file_exists($crt_tmp_file) && !file_exists($key_tmp_file)) {
 				$app->log("Create Let's Encrypt SSL Cert for: $domain", LOGLEVEL_DEBUG);
 
-				if(is_dir($webroot . "/.well-known/")) {
+				if(is_dir($webroot . "/.well-known/acme-challenge/")) {
 					$app->log("Remove old challenge directory", LOGLEVEL_DEBUG);
 					$this->_exec("rm -rf " . $webroot . "/.well-known/acme-challenge/");
 				}
-- 
GitLab