Skip to content

Commit bcfbd4c

Browse files
authored
HostsCAService edge not being generated fix (#145)
* fix: add HostingComputer logic to CertServices collection * chore: add HostingComputer back to CARegistry collection
1 parent a5fc2ae commit bcfbd4c

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/Runtime/ObjectProcessors.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,12 @@ private async Task<EnterpriseCA> ProcessEnterpriseCA(IDirectoryObject entry,
698698
var dnsHostName = entry.GetProperty(LDAPProperties.DNSHostName);
699699

700700
if (caName != null && dnsHostName != null) {
701+
if (await _context.LDAPUtils.ResolveHostToSid(dnsHostName, resolvedSearchResult.DomainSid) is
702+
(true, var sid) && sid.StartsWith("S-1-")) {
703+
ret.HostingComputer = sid;
704+
} else {
705+
_log.LogWarning("CA {Name} host ({Dns}) could not be resolved to a SID.", caName, dnsHostName);
706+
}
701707
var caEnrollmentProcessor = new CAEnrollmentProcessor(dnsHostName, caName, _log);
702708
var ntlmEndpoints = await caEnrollmentProcessor.ScanAsync();
703709
ret.HttpEnrollmentEndpoints = ntlmEndpoints.ToArray();

0 commit comments

Comments
 (0)