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";
38std::expected<void, std::string>
fetchAndSwapCert(
const std::string& certPath,
39 const std::string& keyPath,
40 const std::string& certUrl,
41 const std::string& keyUrl);
67 const std::filesystem::path& defaultCertPath,
68 const std::filesystem::path& defaultKeyPath);
91std::expected<void, std::string>
healCertIfNeeded(
const std::string& certPath,
92 const std::string& keyPath,
bool autoUpdate,
93 const std::string& certUrl,
94 const std::string& keyUrl);
Definition cert_info.cc:13
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:182
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:149
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:214
The TLS cert/key paths the server should use, plus where they came from.
Definition cert_updater.h:44
std::string keyPath
Definition cert_updater.h:46
std::string source
Definition cert_updater.h:49
std::string certPath
Resolved certificate path (always populated).
Definition cert_updater.h:45