From 923e05879db3b9b610961dbffacfcaf05924a38a Mon Sep 17 00:00:00 2001 From: nedko Date: Thu, 23 Jul 2026 16:25:59 +0300 Subject: [PATCH] Added OpenSSL support --- Makefile | 2 +- main.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 6e4be76..9f435c0 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,6 @@ srcs += helpers.cpp srcs += TRMNL.cpp all: - g++ ${srcs} -o server + g++ ${srcs} -o server -lssl -lcrypto .PHONY: all diff --git a/main.cpp b/main.cpp index 42603a2..60a18c0 100644 --- a/main.cpp +++ b/main.cpp @@ -17,6 +17,7 @@ #include #include +#define CPPHTTPLIB_OPENSSL_SUPPORT #include "httplib.h" #include "json.hpp" @@ -223,9 +224,8 @@ int main(int argc, char **argv) json_extract(cfg, "devices_filename", devices_filename); json_extract(cfg, "folder_images", folder_images); - // TODO: Extract when SSL is ready - // json_extract(cfg, "cert_file", cert_file); - // json_extract(cfg, "key_file", cert_file); + json_extract(cfg, "cert_file", cert_file); + json_extract(cfg, "key_file", key_file); json_extract(cfg, "refresh_min", refresh_min); json_extract(cfg, "refresh_offset", refresh_offset); @@ -262,7 +262,7 @@ int main(int argc, char **argv) if (!cert_file.empty() && !key_file.empty()) { - // TODO: Implement SSL Server Properly + server = make_shared(cert_file.c_str(), key_file.c_str()); } else {