14 return "https://github.com/synapticon/motion-master/releases/download/tls-cert/cert.pem";
19 return "https://github.com/synapticon/motion-master/releases/download/tls-cert/key.pem";
40std::expected<void, std::string>
fetchAndSwapCert(
const std::string& certPath,
41 const std::string& keyPath,
42 const std::string& certUrl,
43 const std::string& keyUrl);
69 const std::filesystem::path& defaultCertPath,
70 const std::filesystem::path& defaultKeyPath);
93std::expected<void, std::string>
healCertIfNeeded(
const std::string& certPath,
94 const std::string& keyPath,
bool autoUpdate,
95 const std::string& certUrl,
96 const std::string& keyUrl);
Definition auto_tuning_setup.cc:10
std::string defaultKeyUrl()
Default rolling-release URL for the current TLS private key. See defaultCertUrl.
Definition cert_updater.h:18
ResolvedCert resolveCertPaths(const std::string &configCertPath, const std::string &configKeyPath, const std::filesystem::path &defaultCertPath, const std::filesystem::path &defaultKeyPath)
Resolve the TLS cert/key file paths, choosing by discovery when not configured.
Definition cert_updater.cc:173
std::string defaultCertUrl()
Default rolling-release URL for the current TLS certificate.
Definition cert_updater.h:13
std::expected< void, std::string > fetchAndSwapCert(const std::string &certPath, const std::string &keyPath, const std::string &certUrl, const std::string &keyUrl)
Downloads a fresh certificate and key and atomically installs them.
Definition cert_updater.cc:140
std::expected< void, std::string > healCertIfNeeded(const std::string &certPath, const std::string &keyPath, bool autoUpdate, const std::string &certUrl, const std::string &keyUrl)
Assess the served TLS certificate and refresh it if missing, expired, or expiring soon (the startup "...
Definition cert_updater.cc:207
The TLS cert/key paths the server should use, plus where they came from.
Definition cert_updater.h:46
std::string keyPath
Definition cert_updater.h:48
std::string source
Definition cert_updater.h:51
std::string certPath
Resolved certificate path (always populated).
Definition cert_updater.h:47