From 017df1397ace9ab8c3f152362d07871dcb6858be Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Fri, 5 May 2023 15:52:09 -0400 Subject: Use local cert store if available --- src/ap_state.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/ap_state.cpp') diff --git a/src/ap_state.cpp b/src/ap_state.cpp index 22a51ee..69c9e9f 100644 --- a/src/ap_state.cpp +++ b/src/ap_state.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -25,6 +26,7 @@ constexpr int AP_MAJOR = 0; constexpr int AP_MINOR = 4; constexpr int AP_REVISION = 0; +constexpr const char* CERT_STORE_PATH = "cacert.pem"; constexpr int ITEM_HANDLING = 7; // <- all namespace { @@ -108,7 +110,12 @@ void AP_Connect(std::string server, std::string player, std::string password) { DestroyClient(); } - apclient = new APClient(ap_get_uuid(""), "Lingo", server); + std::string cert_store = ""; + if (std::filesystem::exists(CERT_STORE_PATH)) { + cert_store = CERT_STORE_PATH; + } + + apclient = new APClient(ap_get_uuid(""), "Lingo", server, cert_store); } inventory.clear(); -- cgit 1.4.1