about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2023-05-05 15:52:09 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2023-05-05 15:52:09 -0400
commit017df1397ace9ab8c3f152362d07871dcb6858be (patch)
tree475f475efbd128979e2d57e444164398e70db5f1 /src
parent149e7c0836927e14a926a952bd1a7f0d1b49e779 (diff)
downloadlingo-ap-tracker-017df1397ace9ab8c3f152362d07871dcb6858be.tar.gz
lingo-ap-tracker-017df1397ace9ab8c3f152362d07871dcb6858be.tar.bz2
lingo-ap-tracker-017df1397ace9ab8c3f152362d07871dcb6858be.zip
Use local cert store if available
Diffstat (limited to 'src')
-rw-r--r--src/ap_state.cpp9
1 files changed, 8 insertions, 1 deletions
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 @@
10#include <apuuid.hpp> 10#include <apuuid.hpp>
11#include <chrono> 11#include <chrono>
12#include <exception> 12#include <exception>
13#include <filesystem>
13#include <list> 14#include <list>
14#include <memory> 15#include <memory>
15#include <mutex> 16#include <mutex>
@@ -25,6 +26,7 @@ constexpr int AP_MAJOR = 0;
25constexpr int AP_MINOR = 4; 26constexpr int AP_MINOR = 4;
26constexpr int AP_REVISION = 0; 27constexpr int AP_REVISION = 0;
27 28
29constexpr const char* CERT_STORE_PATH = "cacert.pem";
28constexpr int ITEM_HANDLING = 7; // <- all 30constexpr int ITEM_HANDLING = 7; // <- all
29 31
30namespace { 32namespace {
@@ -108,7 +110,12 @@ void AP_Connect(std::string server, std::string player, std::string password) {
108 DestroyClient(); 110 DestroyClient();
109 } 111 }
110 112
111 apclient = new APClient(ap_get_uuid(""), "Lingo", server); 113 std::string cert_store = "";
114 if (std::filesystem::exists(CERT_STORE_PATH)) {
115 cert_store = CERT_STORE_PATH;
116 }
117
118 apclient = new APClient(ap_get_uuid(""), "Lingo", server, cert_store);
112 } 119 }
113 120
114 inventory.clear(); 121 inventory.clear();