diff --git a/CHANGELOG.md b/CHANGELOG.md index dd5dcb0..370b5fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +v1.4.4 +- Bug Fix: Allow PEM formats with # comments at top of file during inventory + v1.4.3 - Bug Fix: IgnoreSSLWarning was not recognized when set to true - Modified login API call for token auth to fix issue some users were experiencing diff --git a/F5Client.cs b/F5Client.cs index 1cfad32..cc3e9c1 100644 --- a/F5Client.cs +++ b/F5Client.cs @@ -322,8 +322,9 @@ private X509Certificate2Collection GetCertificateEntry(string path) crtBytes = System.Convert.FromBase64String(crt); certificateEntry = System.Text.ASCIIEncoding.ASCII.GetString(crtBytes); break; - //PEM(w / headers)-- > L + //PEM(w / headers)-- > L or I case "L": + case "I": LogHandlerCommon.Trace(logger, CertificateStore, "Certificate is PEM with headers"); crtBytes = System.Convert.FromBase64String(crt); certificateEntry = System.Text.ASCIIEncoding.ASCII.GetString(crtBytes); @@ -335,7 +336,7 @@ private X509Certificate2Collection GetCertificateEntry(string path) } LogHandlerCommon.MethodExit(logger, CertificateStore, "GetCertificateEntry"); - + //LogHandlerCommon.Debug(logger, CertificateStore, certificateEntry); string certificateEntryAfterRemovalOfDelim = certificateEntry.Replace("-----BEGIN CERTIFICATE----- ", "-----BEGIN CERTIFICATE-----"); CertificateCollectionConverter c = CertificateCollectionConverterFactory.FromPEM(certificateEntryAfterRemovalOfDelim); @@ -409,6 +410,7 @@ private CurrentInventoryItem GetInventoryItem(string partition, string name, boo foreach (X509Certificate2 certificate in certificateCollection) { certContents.Add(Convert.ToBase64String(certificate.Export(X509ContentType.Cert))); + //LogHandlerCommon.Debug(logger, CertificateStore, $"ALIAS: {name}: {Convert.ToBase64String(certificate.Export(X509ContentType.Cert))}"); } string crtName = GetCrtName(name, false); diff --git a/F5Orchestrator.csproj b/F5Orchestrator.csproj index b1d7ec2..6b8b133 100644 --- a/F5Orchestrator.csproj +++ b/F5Orchestrator.csproj @@ -12,7 +12,7 @@ - +