Skip to content

Merge to main #144

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 10 commits into from
Closed
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2.6.3
* Fixed reenrollment job when RDN Components contained escaped commas
* Updated renewal job for IIS Certs to delete the old cert if not bound or used by other web sites.
* Improved Inventory reporting of CSP when cert uses newer CNG Keys
* Fixed an issue with complex PFX passwords that contained special characters such as '@' or '$', etc.

2.6.2
* Fixed error when attempting to connect to remote computer using UO service account
* Fixed error when connecting to remote computer using HTTPS; was defaulting to HTTP
Expand Down
2 changes: 1 addition & 1 deletion IISU/ImplementedStoreTypes/WinIIS/Inventory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public JobResult ProcessJob(InventoryJobConfiguration jobConfiguration, SubmitIn
{
Result = OrchestratorJobStatusJobResult.Success,
JobHistoryId = jobConfiguration.JobHistoryId,
FailureMessage = ""
FailureMessage = $"Inventory completed returning {inventoryItems.Count} Items."
};
}

Expand Down
10 changes: 10 additions & 0 deletions IISU/ImplementedStoreTypes/WinIIS/Management.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Management.Automation;
using Keyfactor.Extensions.Orchestrator.WindowsCertStore.Models;
using Keyfactor.Logging;
Expand Down Expand Up @@ -89,6 +90,7 @@ public JobResult ProcessJob(ManagementJobConfiguration config)
string protocol = jobProperties?.WinRmProtocol;
string port = jobProperties?.WinRmPort;
bool includePortInSPN = (bool)jobProperties?.SpnPortFlag;
string alias = config.JobCertificate.Alias.Split(':').FirstOrDefault() ?? string.Empty; // Thumbprint is first part of the alias

_psHelper = new(protocol, port, includePortInSPN, _clientMachineName, serverUserName, serverPassword);

Expand Down Expand Up @@ -171,6 +173,14 @@ public JobResult ProcessJob(ManagementJobConfiguration config)
psResult = OrchestratorJobStatusJobResult.Unknown;
}

// Only is the binding returns successful, check of original cert is still bound to any site, if not remove it from the store
if (psResult == OrchestratorJobStatusJobResult.Success && !string.IsNullOrEmpty(alias))
{
_logger.LogTrace("Attempting to remove original certificate from store if it is no longer bound to any site.");
RemoveIISCertificate(alias);
_logger.LogTrace("Returned from removing cert if not used.");
}

complete = new JobResult
{
Result = psResult,
Expand Down
Loading
Loading