Log when certificate has been refreshed
// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.node.admin.configserver.certificate;
+import com.yahoo.log.LogLevel;
import com.yahoo.net.HostName;
import com.yahoo.vespa.hosted.node.admin.configserver.ConfigServerApi;
import com.yahoo.vespa.hosted.node.admin.util.KeyStoreOptions;
@@ -22,6 +23,7 @@ import java.security.NoSuchProviderException;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.time.Clock;
+import java.time.format.DateTimeFormatter;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
@@ -109,6 +111,10 @@ public class ConfigServerKeyStoreRefresher {
X509Certificate certificate = sendCsr(csr);
storeCertificate(keyPair, certificate);
+
+ String expiry = DateTimeFormatter.ISO_INSTANT.format(certificate.getNotAfter().toInstant());
+ logger.log(LogLevel.INFO, "Key store certificate refreshed, expires " + expiry);
+
return true;
}
