diff --git a/CMakeLists.txt b/CMakeLists.txt
index 544fff3..dab131b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -56,8 +56,6 @@ set(CPACK_DEBIAN_BUILDER_PACKAGE_NAME "sai-builder")
option(SAI_SERVER "Build the server + web part" ON)
option(SAI_BUILDER "Build the builder part" ON)
-set(LWS_OPENSSL_LIBRARIES CACHE PATH "Path to the OpenSSL library")
-set(LWS_OPENSSL_INCLUDE_DIRS CACHE PATH "Path to the OpenSSL include directory")
if (NOT SAI_SERVER AND NOT SAI_BUILDER)
message(FATAL_ERROR "Have to build both or one or the other")
@@ -120,21 +118,6 @@ if (LWS_OPENSSL_INCLUDE_DIRS)
set(CMAKE_C_FLAGS "-I\"${LWS_OPENSSL_INCLUDE_DIRS}\" ${CMAKE_C_FLAGS}")
endif()
-find_package(OpenSSL)
-if (OPENSSL_FOUND)
- include_directories("${OPENSSL_INCLUDE_DIR}")
-endif()
-
-if (APPLE AND EXISTS "/opt/homebrew/opt/openssl/include")
- include_directories("/opt/homebrew/opt/openssl/include")
- link_directories("/opt/homebrew/opt/openssl/lib")
-endif()
-
-if (APPLE AND EXISTS "/opt/homebrew/opt/openssl@3/include")
- include_directories("/opt/homebrew/opt/openssl@3/include")
- link_directories("/opt/homebrew/opt/openssl@3/lib")
-endif()
-
set(CMAKE_C_FLAGS "-DBUILD_INFO=\\\"${LWS_BUILD_HASH}\\\" ${CMAKE_C_FLAGS}")
diff --git a/src/builder/b-deletion.c b/src/builder/b-deletion.c
index b706127..b3b3256 100644
--- a/src/builder/b-deletion.c
+++ b/src/builder/b-deletion.c
@@ -19,6 +19,10 @@
* MA 02110-1301 USA
*/
+#if !defined(_CRT_SECURE_NO_WARNINGS)
+#define _CRT_SECURE_NO_WARNINGS
+#endif
+
#include <libwebsockets.h>
#include <string.h>
#include <signal.h>
@@ -27,6 +31,7 @@
#include <fcntl.h>
#include <sys/types.h>
+#include <sys/stat.h>
#if !defined(WIN32)
#include <pwd.h>
#include <grp.h>
@@ -36,10 +41,6 @@
#include <unistd.h>
#endif
-#if defined(__APPLE__)
-#include <sys/stat.h> /* for mkdir() */
-#endif
-
#if defined(WIN32)
#include <initguid.h>
#include <KnownFolders.h>
@@ -53,6 +54,10 @@
#endif
#endif
+#ifndef S_ISDIR
+#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
+#endif
+
#include "b-private.h"
int