Skip to content

Commit 4b14395

Browse files
committed
Actually assign loaded cert when generating pfx
1 parent f7e7613 commit 4b14395

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/KubernetesClient/CertUtils.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public static X509Certificate2 GeneratePfx(KubernetesClientConfiguration config)
8181
if (config.ClientCertificateKeyStoreFlags.HasValue)
8282
{
8383
#if NET9_0_OR_GREATER
84-
X509CertificateLoader.LoadPkcs12(cert.Export(X509ContentType.Pkcs12), nullPassword, config.ClientCertificateKeyStoreFlags.Value);
84+
cert = X509CertificateLoader.LoadPkcs12(cert.Export(X509ContentType.Pkcs12), nullPassword, config.ClientCertificateKeyStoreFlags.Value);
8585
#else
8686
cert = new X509Certificate2(cert.Export(X509ContentType.Pkcs12), nullPassword, config.ClientCertificateKeyStoreFlags.Value);
8787
#endif
@@ -90,7 +90,7 @@ public static X509Certificate2 GeneratePfx(KubernetesClientConfiguration config)
9090
else
9191
{
9292
#if NET9_0_OR_GREATER
93-
X509CertificateLoader.LoadPkcs12(cert.Export(X509ContentType.Pkcs12), nullPassword);
93+
cert = X509CertificateLoader.LoadPkcs12(cert.Export(X509ContentType.Pkcs12), nullPassword);
9494
#else
9595
cert = new X509Certificate2(cert.Export(X509ContentType.Pkcs12), nullPassword);
9696
#endif

0 commit comments

Comments
 (0)