Skip to content

Commit

Permalink
Fix identifier as path for cases where file starts with con. causing …
Browse files Browse the repository at this point in the history
…failures
  • Loading branch information
webprofusion-chrisc committed Dec 16, 2024
1 parent 58f091b commit 46a3c08
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/Certify.Providers/ACME/Anvil/AnvilACMEProvider.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Globalization;
Expand Down Expand Up @@ -1672,7 +1672,18 @@ public async Task<ProcessStepResult> CompleteCertificateRequest(ILog log, Manage
};
}

private string GetIdentifierAsPath(string identifier) => identifier?.Replace("*", "_") ?? "";
private string GetIdentifierAsPath(string identifier)
{
var path = identifier?.Replace("*", "_") ?? "";

if (path.StartsWith("con."))
{
// on some versions of windows creating a path with a con. prefix fails.
path = path.Replace("con.", "_con.");
}

return path;
}

private string GetPrimaryIdentifierAsPath(CertRequestConfig config, string internalId) => GetIdentifierAsPath(string.IsNullOrEmpty(config.PrimaryDomain) ? internalId : config.PrimaryDomain);

Expand Down

0 comments on commit 46a3c08

Please sign in to comment.