Skip to content

Commit 46a3c08

Browse files
Fix identifier as path for cases where file starts with con. causing failures
1 parent 58f091b commit 46a3c08

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/Certify.Providers/ACME/Anvil/AnvilACMEProvider.cs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Concurrent;
33
using System.Collections.Generic;
44
using System.Globalization;
@@ -1672,7 +1672,18 @@ public async Task<ProcessStepResult> CompleteCertificateRequest(ILog log, Manage
16721672
};
16731673
}
16741674

1675-
private string GetIdentifierAsPath(string identifier) => identifier?.Replace("*", "_") ?? "";
1675+
private string GetIdentifierAsPath(string identifier)
1676+
{
1677+
var path = identifier?.Replace("*", "_") ?? "";
1678+
1679+
if (path.StartsWith("con."))
1680+
{
1681+
// on some versions of windows creating a path with a con. prefix fails.
1682+
path = path.Replace("con.", "_con.");
1683+
}
1684+
1685+
return path;
1686+
}
16761687

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

0 commit comments

Comments
 (0)