Skip to content

Commit 7a4f0ad

Browse files
authored
Merge 967dd44 into 084bb01
2 parents 084bb01 + 967dd44 commit 7a4f0ad

20 files changed

+800
-170
lines changed

.github/workflows/keyfactor-starter-workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111

1212
jobs:
1313
call-starter-workflow:
14-
uses: keyfactor/actions/.github/workflows/starter.yml@v2
14+
uses: keyfactor/actions/.github/workflows/starter.yml@3.1.0-rc.0
1515
secrets:
1616
token: ${{ secrets.V2BUILDTOKEN}}
1717
APPROVE_README_PUSH: ${{ secrets.APPROVE_README_PUSH}}

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2+
2.5.0
3+
* Added the Bindings to the end of the thumbprint to make the alias unique.
4+
* Using new IISWebBindings commandlet to use additional SSL flags when binding certificate to website.
5+
* Added multi-platform support for .Net6 and .Net8.
6+
17
2.4.4
28
* Fix an issue with WinRM parameters when migrating Legacy IIS Stores to the WinCert type
39
* Fix an issue with "Delete" script in the Legacy IIS Migration that did not remove some records from dependent tables

IISU/CertificateStore.cs

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -181,38 +181,21 @@ public static List<CurrentInventoryItem> GetIISBoundCertificates(Runspace runSpa
181181

182182
if (foundCert == null) continue;
183183

184-
var sniValue = "";
185-
switch (Convert.ToInt16(binding.Properties["sniFlg"]?.Value))
186-
{
187-
case 0:
188-
sniValue = "0 - No SNI";
189-
break;
190-
case 1:
191-
sniValue = "1 - SNI Enabled";
192-
break;
193-
case 2:
194-
sniValue = "2 - Non SNI Binding";
195-
break;
196-
case 3:
197-
sniValue = "3 - SNI Binding";
198-
break;
199-
}
200-
201184
var siteSettingsDict = new Dictionary<string, object>
202185
{
203186
{ "SiteName", binding.Properties["Name"]?.Value },
204187
{ "Port", binding.Properties["Bindings"]?.Value.ToString()?.Split(':')[1] },
205188
{ "IPAddress", binding.Properties["Bindings"]?.Value.ToString()?.Split(':')[0] },
206189
{ "HostName", binding.Properties["Bindings"]?.Value.ToString()?.Split(':')[2] },
207-
{ "SniFlag", sniValue },
190+
{ "SniFlag", binding.Properties["sniFlg"]?.Value },
208191
{ "Protocol", binding.Properties["Protocol"]?.Value }
209192
};
210193

211194
myBoundCerts.Add(
212195
new CurrentInventoryItem
213196
{
214197
Certificates = new[] { foundCert.CertificateData },
215-
Alias = thumbPrint,
198+
Alias = thumbPrint + ":" + binding.Properties["Bindings"]?.Value.ToString(),
216199
PrivateKeyEntry = foundCert.HasPrivateKey,
217200
UseChainLevel = false,
218201
ItemStatus = OrchestratorInventoryItemStatus.Unknown,

IISU/CertificateStoreException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
namespace Keyfactor.Extensions.Orchestrator.WindowsCertStore
1919
{
2020
[Serializable]
21-
internal class CertificateStoreException : Exception
21+
public class CertificateStoreException : Exception
2222
{
2323
public CertificateStoreException()
2424
{

IISU/ClientPSCertStoreInventory.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14+
using Keyfactor.Extensions.Orchestrator.WindowsCertStore.IISU;
1415
using Keyfactor.Logging;
1516
using Microsoft.Extensions.Logging;
1617
using System;
@@ -21,9 +22,15 @@
2122

2223
namespace Keyfactor.Extensions.Orchestrator.WindowsCertStore
2324
{
24-
abstract class ClientPSCertStoreInventory
25+
public abstract class ClientPSCertStoreInventory
2526
{
2627
private ILogger _logger;
28+
29+
protected ClientPSCertStoreInventory()
30+
{
31+
_logger = LogHandler.GetClassLogger<ClientPSCertStoreInventory>();
32+
}
33+
2734
public ClientPSCertStoreInventory(ILogger logger)
2835
{
2936
_logger = logger;

IISU/ClientPSCertStoreManager.cs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
namespace Keyfactor.Extensions.Orchestrator.WindowsCertStore
2929
{
30-
internal class ClientPSCertStoreManager
30+
public class ClientPSCertStoreManager
3131
{
3232
private ILogger _logger;
3333
private Runspace _runspace;
@@ -40,6 +40,11 @@ public X509Certificate2 X509Cert
4040
get { return x509Cert; }
4141
}
4242

43+
public ClientPSCertStoreManager(Runspace runSpace)
44+
{
45+
_logger = LogHandler.GetClassLogger<ClientPSCertStoreManager>();
46+
_runspace = runSpace;
47+
}
4348

4449
public ClientPSCertStoreManager(ILogger logger, Runspace runSpace, long jobNumber)
4550
{
@@ -126,9 +131,9 @@ public JobResult ImportPFXFile(string filePath, string privateKeyPassword, strin
126131
{
127132
ps.Runspace = _runspace;
128133

129-
if (cryptoProviderName == null)
134+
if (string.IsNullOrEmpty(cryptoProviderName))
130135
{
131-
if (privateKeyPassword == null)
136+
if (string.IsNullOrEmpty(privateKeyPassword))
132137
{
133138
// If no private key password is provided, import the pfx file directory to the store using addstore argument
134139
string script = @"
@@ -179,7 +184,7 @@ public JobResult ImportPFXFile(string filePath, string privateKeyPassword, strin
179184
}
180185
else
181186
{
182-
if (privateKeyPassword == null)
187+
if (string.IsNullOrEmpty(privateKeyPassword))
183188
{
184189
string script = @"
185190
param($pfxFilePath, $cspName, $storePath)

0 commit comments

Comments
 (0)