Skip to content

Commit 41a4e9a

Browse files
Implement option to disable ARI checks
1 parent 0fd6b45 commit 41a4e9a

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

src/Certify.Core/Management/CertifyManager/CertifyManager.Maintenance.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,8 @@ private async Task PerformCertificateStatusChecks(CancellationToken cancelToken,
238238
var itemsOcspExpired = new List<string>();
239239
var itemsViaARI = new Dictionary<string, DateTimeOffset>();
240240

241+
var disableARIChecks = CoreAppSettings.Current.DisableARIChecks;
242+
241243
if (ocspItemsToCheck?.Any() == true)
242244
{
243245
_serviceLog.Information(template: $"Checking OCSP for {ocspItemsToCheck.Count} items");
@@ -288,7 +290,7 @@ private async Task PerformCertificateStatusChecks(CancellationToken cancelToken,
288290
_serviceLog.Verbose("Completed OCSP status checks");
289291
}
290292

291-
if (!cancelToken.IsCancellationRequested)
293+
if (!disableARIChecks && !cancelToken.IsCancellationRequested)
292294
{
293295
var renewalInfoItemsToCheck = await _itemManager.Find(new ManagedCertificateFilter { LastRenewalInfoCheckMins = (managedItemId == null ? lastCheckOlderThanMinutes : (int?)null), MaxResults = batchSize, Id = managedItemId });
294296

@@ -391,6 +393,10 @@ private async Task PerformCertificateStatusChecks(CancellationToken cancelToken,
391393
}
392394
}
393395
}
396+
else if (disableARIChecks)
397+
{
398+
_serviceLog.Information("ARI Checks are disabled.");
399+
}
394400

395401
var allItemsToUpdate = new List<string>(completedOcspUpdateChecks);
396402

src/Certify.Core/Management/SettingsManager.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,11 @@ public static CoreAppSettings Current
181181
public bool PerformChallengeCleanupsLast { get; set; }
182182
public string CurrentServiceVersion { get; set; }
183183

184+
/// <summary>
185+
/// If true, ARI checks will not be performed during periodic maintenance
186+
/// </summary>
187+
public bool DisableARIChecks { get; set; }
188+
184189
/// <summary>
185190
/// if true, additional management hub features and data stores may be enabled
186191
/// </summary>
@@ -240,7 +245,10 @@ public static bool FromPreferences(Models.Preferences prefs)
240245

241246
CoreAppSettings.Current.DefaultACMERetryInterval = prefs.DefaultACMERetryInterval;
242247

248+
CoreAppSettings.Current.DisableARIChecks = prefs.DisableARIChecks;
249+
243250
CoreAppSettings.Current.EnableIssuerCache = prefs.EnableIssuerCache;
251+
244252
return true;
245253
}
246254

@@ -276,6 +284,7 @@ public static Models.Preferences ToPreferences()
276284
ConfigDataStoreConnectionId = CoreAppSettings.Current.ConfigDataStoreConnectionId,
277285
DefaultKeyType = CoreAppSettings.Current.DefaultKeyType,
278286
EnableParallelRenewals = CoreAppSettings.Current.EnableParallelRenewals,
287+
DisableARIChecks = CoreAppSettings.Current.DisableARIChecks,
279288
DefaultACMERetryInterval = CoreAppSettings.Current.DefaultACMERetryInterval
280289
};
281290

src/Certify.Models/Config/Preferences.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,11 @@ public class Preferences : BindableBase
129129
/// If true, system CA roots etc are loaded during chain build to help validate chain
130130
/// </summary>
131131
public bool EnableIssuerCache { get; set; }
132+
133+
/// <summary>
134+
/// If true, ARI checks will not be performed during periodic maintenance
135+
/// </summary>
136+
public bool DisableARIChecks { get; set; }
132137
}
133138

134139
public static class FeatureFlags

0 commit comments

Comments
 (0)