diff --git a/src/LetsEncrypt/Entities/LetsEncrypt/RegistrationCache.cs b/src/LetsEncrypt/Entities/LetsEncrypt/RegistrationCache.cs
index 0c49e77..1228735 100644
--- a/src/LetsEncrypt/Entities/LetsEncrypt/RegistrationCache.cs
+++ b/src/LetsEncrypt/Entities/LetsEncrypt/RegistrationCache.cs
@@ -26,7 +26,35 @@ public class RegistrationCache {
public Uri? Location { get; set; }
///
- ///
+ /// Returns a list of hosts with upcoming SSL expiry
+ ///
+ public string[] HostsWithUpcomingSslExpiry {
+
+ get {
+
+ var hostsWithUpcomingSslExpiry = new List();
+
+ if (CachedCerts == null)
+ return hostsWithUpcomingSslExpiry.ToArray();
+
+ foreach (var result in CachedCerts) {
+ var (subject, cachedChert) = result;
+
+ if (cachedChert.Cert != null) {
+ var cert = new X509Certificate2(Encoding.ASCII.GetBytes(cachedChert.Cert));
+
+ // if it is about to expire, we need to refresh
+ if ((cert.NotAfter - DateTime.UtcNow).TotalDays < 30)
+ hostsWithUpcomingSslExpiry.Add(subject);
+ }
+ }
+
+ return hostsWithUpcomingSslExpiry.ToArray();
+ }
+ }
+
+ ///
+ /// Returns cached certificate. Certs older than 30 days are not returned
///
///
///
@@ -43,7 +71,6 @@ public class RegistrationCache {
var cert = new X509Certificate2(Encoding.ASCII.GetBytes(cache.Cert));
- // if it is about to expire, we need to refresh
if ((cert.NotAfter - DateTime.UtcNow).TotalDays < 30)
return false;