This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user