Add UseSSL option to server config

This commit is contained in:
Lion Kortlepel
2021-12-06 13:47:07 +01:00
parent a1335e8c7d
commit 3cce875fbb
4 changed files with 69 additions and 43 deletions

View File

@@ -52,6 +52,7 @@ public:
bool SendErrors { true };
bool SendErrorsMessageEnabled { true };
int HTTPServerPort { 8080 };
bool HTTPServerUseSSL { true };
[[nodiscard]] bool HasCustomIP() const { return !CustomIP.empty(); }
};

View File

@@ -4,6 +4,9 @@
#include <atomic>
#define TOML11_PRESERVE_COMMENTS_BY_DEFAULT
#include <toml11/toml.hpp> // header-only version of TOML++
namespace fs = std::filesystem;
class TConfig {
@@ -18,10 +21,12 @@ private:
void CreateConfigFile(std::string_view name);
void ParseFromFile(std::string_view name);
void PrintDebug();
void TryReadValue(toml::value& Table, const std::string& Category, const std::string_view& Key, std::string& OutValue);
void TryReadValue(toml::value& Table, const std::string& Category, const std::string_view& Key, bool& OutValue);
void TryReadValue(toml::value& Table, const std::string& Category, const std::string_view& Key, int& OutValue);
void ParseOldFormat();
bool IsDefault();
bool mFailed { false };
std::string mConfigFileName;
};