Skip to content

Commit 7df60dc

Browse files
Merge main into localdns: Add Infoblox support, keep RFC2136 and DnsVerificationServer
- Merged Infoblox DNS provider from main branch - Kept RFC2136 DNS provider for BIND/dynamic DNS support - Kept DnsVerificationServer option for private DNS zone verification - Removed Windows DNS provider (doesn't support standard TSIG) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2 parents ea70dfb + 25325fa commit 7df60dc

9 files changed

Lines changed: 448 additions & 142 deletions

File tree

AcmeCaPlugin/AcmeCaPlugin.cs

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ private async Task ProcessAuthorizations(AcmeClient acmeClient, OrderDetails ord
370370
if (validation == null)
371371
throw new InvalidOperationException($"Failed to decode {DNS_CHALLENGE_TYPE} challenge validation details");
372372

373-
// Create DNS record
373+
// Create DNS record (will throw exception with details if it fails)
374374
var dnsProvider = DnsProviderFactory.Create(config, _logger);
375375
await dnsProvider.CreateRecordAsync(validation.DnsRecordName, validation.DnsRecordValue);
376376

@@ -383,22 +383,34 @@ private async Task ProcessAuthorizations(AcmeClient acmeClient, OrderDetails ord
383383
// Second pass: Wait for DNS propagation and submit challenges
384384
foreach (var (authz, challenge, validation) in pendingChallenges)
385385
{
386-
_logger.LogInformation("Waiting for DNS propagation for {Domain}...", authz.Identifier.Value);
386+
// Skip external DNS verification for Infoblox since it cannot ping external DNS providers
387+
bool isInfoblox = config.DnsProvider?.Trim().Equals("infoblox", StringComparison.OrdinalIgnoreCase) ?? false;
387388

388-
// Wait for DNS propagation with verification
389-
var propagated = await dnsVerifier.WaitForDnsPropagationAsync(
390-
validation.DnsRecordName,
391-
validation.DnsRecordValue,
392-
minimumServers: 3 // Require at least 3 DNS servers to confirm
393-
);
394-
395-
if (!propagated)
389+
if (isInfoblox)
390+
{
391+
_logger.LogInformation("Skipping external DNS propagation check for Infoblox provider for {Domain}. Adding short delay...", authz.Identifier.Value);
392+
// Add a short delay to allow Infoblox to process the record internally
393+
await Task.Delay(TimeSpan.FromSeconds(5));
394+
}
395+
else
396396
{
397-
_logger.LogWarning("DNS record may not have fully propagated for {Domain}. Proceeding anyway...",
398-
authz.Identifier.Value);
397+
_logger.LogInformation("Waiting for DNS propagation for {Domain}...", authz.Identifier.Value);
399398

400-
// Optional: Add a final delay as fallback
401-
await Task.Delay(TimeSpan.FromSeconds(30));
399+
// Wait for DNS propagation with verification
400+
var propagated = await dnsVerifier.WaitForDnsPropagationAsync(
401+
validation.DnsRecordName,
402+
validation.DnsRecordValue,
403+
minimumServers: 3 // Require at least 3 DNS servers to confirm
404+
);
405+
406+
if (!propagated)
407+
{
408+
_logger.LogWarning("DNS record may not have fully propagated for {Domain}. Proceeding anyway...",
409+
authz.Identifier.Value);
410+
411+
// Optional: Add a final delay as fallback
412+
await Task.Delay(TimeSpan.FromSeconds(30));
413+
}
402414
}
403415

404416
// Submit challenge response

AcmeCaPlugin/AcmeCaPluginConfig.cs

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public static Dictionary<string, PropertyConfigInfo> GetPluginAnnotations()
4646
},
4747
["DnsProvider"] = new PropertyConfigInfo()
4848
{
49-
Comments = "DNS Provider to use for ACME DNS-01 challenges (options: Google, Cloudflare, AwsRoute53, Azure, Ns1, Rfc2136)",
49+
Comments = "DNS Provider to use for ACME DNS-01 challenges (options: Google, Cloudflare, AwsRoute53, Azure, Ns1, Rfc2136, Infoblox)",
5050
Hidden = false,
5151
DefaultValue = "Google",
5252
Type = "String"
@@ -183,6 +183,30 @@ public static Dictionary<string, PropertyConfigInfo> GetPluginAnnotations()
183183
Type = "String"
184184
}
185185

186+
//Infoblox DNS
187+
,
188+
["Infoblox_Host"] = new PropertyConfigInfo()
189+
{
190+
Comments = "Infoblox DNS: API URL (e.g., https://infoblox.example.com/wapi/v2.12) only if using Infoblox DNS (Optional)",
191+
Hidden = false,
192+
DefaultValue = "",
193+
Type = "String"
194+
},
195+
["Infoblox_Username"] = new PropertyConfigInfo()
196+
{
197+
Comments = "Infoblox DNS: Username for authentication only if using Infoblox DNS (Optional)",
198+
Hidden = false,
199+
DefaultValue = "",
200+
Type = "String"
201+
},
202+
["Infoblox_Password"] = new PropertyConfigInfo()
203+
{
204+
Comments = "Infoblox DNS: Password for authentication only if using Infoblox DNS (Optional)",
205+
Hidden = true,
206+
DefaultValue = "",
207+
Type = "Secret"
208+
}
209+
186210
};
187211
}
188212

AcmeCaPlugin/AcmeClientConfig.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,21 @@ public class AcmeClientConfig
3434
//IBM NS1 DNS Ns1_ApiKey
3535
public string Ns1_ApiKey { get; set; } = null;
3636

37-
// RFC 2136 Dynamic DNS (BIND/Microsoft DNS)
37+
// RFC 2136 Dynamic DNS (BIND)
3838
public string Rfc2136_Server { get; set; } = null;
3939
public int Rfc2136_Port { get; set; } = 53;
4040
public string Rfc2136_Zone { get; set; } = null;
4141
public string Rfc2136_TsigKeyName { get; set; } = null;
4242
public string Rfc2136_TsigKey { get; set; } = null;
4343
public string Rfc2136_TsigAlgorithm { get; set; } = "hmac-sha256";
4444

45+
// Infoblox DNS
46+
public string Infoblox_Host { get; set; } = null;
47+
public string Infoblox_Username { get; set; } = null;
48+
public string Infoblox_Password { get; set; } = null;
49+
public string Infoblox_WapiVersion { get; set; } = "2.12";
50+
public bool Infoblox_IgnoreSslErrors { get; set; } = false;
51+
4552
// DNS Verification Settings
4653
public string DnsVerificationServer { get; set; } = null;
4754

AcmeCaPlugin/Clients/DNS/DnsProviderFactory.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,15 @@ public static IDnsProvider Create(AcmeClientConfig config, ILogger logger)
4949
config.Rfc2136_Port,
5050
logger
5151
);
52+
case "infoblox":
53+
return new InfobloxDnsProvider(
54+
config.Infoblox_Host,
55+
config.Infoblox_Username,
56+
config.Infoblox_Password,
57+
config.Infoblox_WapiVersion,
58+
config.Infoblox_IgnoreSslErrors,
59+
logger
60+
);
5261
default:
5362
throw new NotSupportedException($"DNS provider '{config.DnsProvider}' is not supported.");
5463
}

0 commit comments

Comments
 (0)