File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 88#endif
99using System ;
1010using System . IO ;
11+ using System . Runtime . InteropServices ;
1112using System . Security . Cryptography . X509Certificates ;
1213using System . Text ;
1314
1415namespace k8s
1516{
16- public static class CertUtils
17+ internal static class CertUtils
1718 {
1819 /// <summary>
1920 /// Load pem encoded cert file
@@ -90,7 +91,15 @@ public static X509Certificate2 GeneratePfx(KubernetesClientConfiguration config)
9091 }
9192
9293
93- return X509Certificate2 . CreateFromPem ( certData , keyData ) ;
94+ var cert = X509Certificate2 . CreateFromPem ( certData , keyData ) ;
95+
96+ // see https://github.com/kubernetes-client/csharp/issues/737
97+ if ( RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) )
98+ {
99+ cert = new X509Certificate2 ( cert . Export ( X509ContentType . Pkcs12 ) ) ;
100+ }
101+
102+ return cert ;
94103#else
95104
96105 byte [ ] keyData = null ;
You can’t perform that action at this time.
0 commit comments