Skip to content

Commit 4f3415d

Browse files
authored
full clone cacert from config object (#1437)
* full clone cacert from config ojb * happy net48 * blame copilot
1 parent f55d1fa commit 4f3415d

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/KubernetesClient/Kubernetes.ConfigInit.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,18 @@ public Kubernetes(KubernetesClientConfiguration config, params DelegatingHandler
2323
{
2424
Initialize();
2525
ValidateConfig(config);
26-
CaCerts = config.SslCaCerts;
26+
27+
if (config.SslCaCerts != null)
28+
{
29+
var caCerts = new X509Certificate2Collection();
30+
foreach (var cert in config.SslCaCerts)
31+
{
32+
caCerts.Add(new X509Certificate2(cert));
33+
}
34+
35+
CaCerts = caCerts;
36+
}
37+
2738
SkipTlsVerify = config.SkipTlsVerify;
2839
TlsServerName = config.TlsServerName;
2940
CreateHttpClient(handlers, config);

0 commit comments

Comments
 (0)