diff --git a/lib/remote/apilistener.cpp b/lib/remote/apilistener.cpp index f5e6e302a..f0ac42cc4 100644 --- a/lib/remote/apilistener.cpp +++ b/lib/remote/apilistener.cpp @@ -181,12 +181,12 @@ void ApiListener::OnConfigLoaded() UpdateSSLContext(); } -std::shared_ptr ApiListener::RenewCert(const std::shared_ptr& cert) +std::shared_ptr ApiListener::RenewCert(const std::shared_ptr& cert, bool ca) { std::shared_ptr pubkey (X509_get_pubkey(cert.get()), EVP_PKEY_free); auto subject (X509_get_subject_name(cert.get())); auto cacert (GetX509Certificate(GetDefaultCaPath())); - auto newcert (CreateCertIcingaCA(pubkey.get(), subject)); + auto newcert (CreateCertIcingaCA(pubkey.get(), subject, ca)); /* verify that the new cert matches the CA we're using for the ApiListener; * this ensures that the CA we have in /var/lib/icinga2/ca matches the one diff --git a/lib/remote/apilistener.hpp b/lib/remote/apilistener.hpp index ffe97a2b3..48e7e4c42 100644 --- a/lib/remote/apilistener.hpp +++ b/lib/remote/apilistener.hpp @@ -91,7 +91,7 @@ public: static String GetCaDir(); static String GetCertificateRequestsDir(); - std::shared_ptr RenewCert(const std::shared_ptr& cert); + std::shared_ptr RenewCert(const std::shared_ptr& cert, bool ca = false); void UpdateSSLContext(); static ApiListener::Ptr GetInstance();