Motion Master 6.0.0-alpha.50
Next-generation motion control software
Loading...
Searching...
No Matches
cert_updater.cc File Reference
#include "cert_updater.h"
#include <curl/curl.h>
#include <openssl/bio.h>
#include <openssl/evp.h>
#include <openssl/pem.h>
#include <openssl/x509.h>
#include <spdlog/spdlog.h>
#include <algorithm>
#include <chrono>
#include <cstddef>
#include <cstdlib>
#include <filesystem>
#include <fstream>
#include <ios>
#include <memory>
#include <string>
#include <system_error>
#include "cert_info.h"
Include dependency graph for cert_updater.cc:

Namespaces

namespace  mm
 

Functions

std::expected< void, std::string > mm::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.
 
ResolvedCert mm::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.
 
std::expected< void, std::string > mm::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 "cert self-heal").