Skip to content

Commit d3e2bc6

Browse files
added propigation wait
1 parent bdb9695 commit d3e2bc6

File tree

1 file changed

+37
-2
lines changed

1 file changed

+37
-2
lines changed

AcmeCaPlugin/AcmeCaPlugin.cs

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -560,8 +560,43 @@ private async Task ProcessAuthorizations(AcmeClient acmeClient, OrderDetails ord
560560
pendingChallenges.Add((authz, challenge, validation));
561561
}
562562

563-
// Second pass: Wait for propagation and submit challenges
564-
// ... rest of your existing code ...
563+
// Second pass: Wait for DNS propagation and submit challenges
564+
foreach (var (authz, challenge, validation) in pendingChallenges)
565+
{
566+
// Skip external DNS verification for Infoblox since it cannot ping external DNS providers
567+
bool isInfoblox = config.DnsProvider?.Trim().Equals("infoblox", StringComparison.OrdinalIgnoreCase) ?? false;
568+
569+
if (isInfoblox)
570+
{
571+
_logger.LogInformation("Skipping external DNS propagation check for Infoblox provider for {Domain}. Adding short delay...", authz.Identifier.Value);
572+
// Add a short delay to allow Infoblox to process the record internally
573+
await Task.Delay(TimeSpan.FromSeconds(5));
574+
}
575+
else
576+
{
577+
_logger.LogInformation("Waiting for DNS propagation for {Domain}...", authz.Identifier.Value);
578+
579+
// Wait for DNS propagation with verification
580+
var propagated = await dnsVerifier.WaitForDnsPropagationAsync(
581+
validation.DnsRecordName,
582+
validation.DnsRecordValue,
583+
minimumServers: 3 // Require at least 3 DNS servers to confirm
584+
);
585+
586+
if (!propagated)
587+
{
588+
_logger.LogWarning("DNS record may not have fully propagated for {Domain}. Proceeding anyway...",
589+
authz.Identifier.Value);
590+
591+
// Optional: Add a final delay as fallback
592+
await Task.Delay(TimeSpan.FromSeconds(30));
593+
}
594+
}
595+
596+
// Submit challenge response
597+
_logger.LogInformation("Submitting challenge for {Domain}", authz.Identifier.Value);
598+
await acmeClient.AnswerChallengeAsync(challenge);
599+
}
565600

566601
// Optional: Cleanup after challenges complete
567602
foreach (var (authz, challenge, validation) in pendingChallenges)

0 commit comments

Comments
 (0)