This commit is contained in:
@@ -41,15 +41,16 @@ namespace rockfishCore.Util
|
|||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// check if an ssl cert is within 10 days of expiry
|
/// check if an ssl cert is within 30 days of expiry
|
||||||
|
/// (30 days is the minimum threshold for LetsEncrypt to allow re-up)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="url"></param>
|
/// <param name="url"></param>
|
||||||
/// <returns>null if more than 10 days before expiry or the expiry date for display</returns>
|
/// <returns>null if more than 30 days before expiry or the expiry date for display</returns>
|
||||||
public static DateTime? SSLCertExpiryDate(string url)
|
public static DateTime? SSLCertExpiryDate(string url)
|
||||||
{
|
{
|
||||||
var expires = GetServerCertificateExpiryAsync(url).Result;
|
var expires = GetServerCertificateExpiryAsync(url).Result;
|
||||||
//In 10 days will we be past the expiry date
|
//In 30 days will we be past the expiry date?
|
||||||
var deadline = DateTime.Now.AddDays(100);
|
var deadline = DateTime.Now.AddDays(30);
|
||||||
if (expires < deadline)
|
if (expires < deadline)
|
||||||
{
|
{
|
||||||
return expires;
|
return expires;
|
||||||
|
|||||||
Reference in New Issue
Block a user