This commit is contained in:
2019-07-08 18:25:13 +00:00
parent c95b421924
commit 9499b50f26
5 changed files with 102 additions and 51 deletions

View File

@@ -44,18 +44,18 @@ namespace rockfishCore.Util
/// check if an ssl cert is within 10 days of expiry
/// </summary>
/// <param name="url"></param>
/// <returns></returns>
public static bool IsSSLCertAboutToExpire(string url)
/// <returns>null if more than 10 days before expiry or the expiry date for display</returns>
public static DateTime? SSLCertExpiryDate(string url)
{
var expires = GetServerCertificateExpiryAsync(url).Result;
//In 10 days will we be past the expiry date
var deadline = DateTime.Now.AddDays(10);
var deadline = DateTime.Now.AddDays(100);
if (expires < deadline)
{
return true;
return expires;
}
return false;
return null;
}