Added OpenSSL support

This commit is contained in:
2026-07-23 16:25:59 +03:00
parent 395ac4781a
commit 923e05879d
2 changed files with 5 additions and 5 deletions

View File

@@ -3,6 +3,6 @@ srcs += helpers.cpp
srcs += TRMNL.cpp
all:
g++ ${srcs} -o server
g++ ${srcs} -o server -lssl -lcrypto
.PHONY: all

View File

@@ -17,6 +17,7 @@
#include <fcntl.h>
#include <sys/stat.h>
#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<httplib::SSLServer>(cert_file.c_str(), key_file.c_str());
}
else
{