diff --git a/src/KubernetesClient/CertUtils.cs b/src/KubernetesClient/CertUtils.cs index cb8af5d2..7a398d7e 100644 --- a/src/KubernetesClient/CertUtils.cs +++ b/src/KubernetesClient/CertUtils.cs @@ -81,7 +81,7 @@ public static X509Certificate2 GeneratePfx(KubernetesClientConfiguration config) if (config.ClientCertificateKeyStoreFlags.HasValue) { #if NET9_0_OR_GREATER - X509CertificateLoader.LoadPkcs12(cert.Export(X509ContentType.Pkcs12), nullPassword, config.ClientCertificateKeyStoreFlags.Value); + cert = X509CertificateLoader.LoadPkcs12(cert.Export(X509ContentType.Pkcs12), nullPassword, config.ClientCertificateKeyStoreFlags.Value); #else cert = new X509Certificate2(cert.Export(X509ContentType.Pkcs12), nullPassword, config.ClientCertificateKeyStoreFlags.Value); #endif @@ -90,7 +90,7 @@ public static X509Certificate2 GeneratePfx(KubernetesClientConfiguration config) else { #if NET9_0_OR_GREATER - X509CertificateLoader.LoadPkcs12(cert.Export(X509ContentType.Pkcs12), nullPassword); + cert = X509CertificateLoader.LoadPkcs12(cert.Export(X509ContentType.Pkcs12), nullPassword); #else cert = new X509Certificate2(cert.Export(X509ContentType.Pkcs12), nullPassword); #endif diff --git a/tests/KubernetesClient.Tests/AuthTests.cs b/tests/KubernetesClient.Tests/AuthTests.cs index 3e9cf684..227ccb66 100644 --- a/tests/KubernetesClient.Tests/AuthTests.cs +++ b/tests/KubernetesClient.Tests/AuthTests.cs @@ -167,8 +167,8 @@ public void BasicAuth() } } - // this test doesn't work on OSX and is inconsistent on windows - [OperatingSystemDependentFact(Exclude = OperatingSystems.OSX | OperatingSystems.Windows)] + // this test doesn't work on OSX + [OperatingSystemDependentFact(Exclude = OperatingSystems.OSX)] public void Cert() { var serverCertificateData = File.ReadAllText("assets/apiserver-pfx-data.txt"); @@ -273,7 +273,7 @@ public void Cert() } } - [OperatingSystemDependentFact(Exclude = OperatingSystems.OSX | OperatingSystems.Windows)] + [OperatingSystemDependentFact(Exclude = OperatingSystems.OSX)] public void ExternalCertificate() { const string name = "testing_irrelevant";