Skip to content

Commit

Permalink
add certificate passed by env to root certs
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Busse committed Feb 26, 2024
1 parent 9233922 commit dfd13b3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/client/include/RestDefaultClientCertificates.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ class DefaultCertificate {
_concatenated_certificates += root_certificates[1];
_concatenated_certificates += root_certificates[2];
_concatenated_certificates += root_certificates[3];

if (auto filename = std::getenv("OPENCMW_REST_CERT_FILE"); filename) {
std::ifstream ifs{ filename };
if (!ifs.is_open()) {
std::string cert;
ifs >> cert;
_concatenated_certificates += cert;
}
}
}
constexpr std::string get() const noexcept {
return _concatenated_certificates;
Expand Down

0 comments on commit dfd13b3

Please sign in to comment.