szaszm commented on code in PR #1336:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1336#discussion_r876200492
##########
libminifi/src/controllers/SSLContextService.cpp:
##########
@@ -563,6 +559,89 @@ void SSLContextService::initializeProperties() {
setSupportedProperties(supportedProperties);
}
+void SSLContextService::verifyCertificateExpiration() {
+ auto verify = [&] (const std::string& cert_file, const
utils::tls::X509_unique_ptr& cert) {
+ if (auto end_date = utils::tls::getCertificateExpiration(cert)) {
+ std::string end_date_str =
getTimeStr(std::chrono::duration_cast<std::chrono::milliseconds>(end_date->time_since_epoch()).count());
+ if (end_date.value() < std::chrono::system_clock::now()) {
+ core::logging::LOG_ERROR(logger_) << "Certificate in '" << cert_file
<< "' expired at " << end_date_str;
+ } else if (auto diff = end_date.value() -
std::chrono::system_clock::now(); diff < std::chrono::months{3}) {
+ core::logging::LOG_WARN(logger_) << "Certificate in '" << cert_file <<
"' will expire at " << end_date_str;
Review Comment:
This makes sense, thanks Martin. Then only my first point remains, I think 2
weeks is enough notice. If someone is using Let's Encrypt, then they get 90 day
certs, usually with automated renewal, which means they would get these
warnings all the time.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]