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 8
8
#endif
9
9
using System ;
10
10
using System . IO ;
11
+ using System . Runtime . InteropServices ;
11
12
using System . Security . Cryptography . X509Certificates ;
12
13
using System . Text ;
13
14
14
15
namespace k8s
15
16
{
16
- public static class CertUtils
17
+ internal static class CertUtils
17
18
{
18
19
/// <summary>
19
20
/// Load pem encoded cert file
@@ -90,7 +91,15 @@ public static X509Certificate2 GeneratePfx(KubernetesClientConfiguration config)
90
91
}
91
92
92
93
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 ;
94
103
#else
95
104
96
105
byte [ ] keyData = null ;
You can’t perform that action at this time.
0 commit comments