From 93170e0fda2e9d390423aceab68ea36687101494 Mon Sep 17 00:00:00 2001 From: Boshi LIAN Date: Wed, 25 Oct 2023 13:56:09 -0700 Subject: [PATCH] happy net48 --- src/KubernetesClient/Kubernetes.ConfigInit.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/KubernetesClient/Kubernetes.ConfigInit.cs b/src/KubernetesClient/Kubernetes.ConfigInit.cs index 5f6a5231b..e5e633004 100644 --- a/src/KubernetesClient/Kubernetes.ConfigInit.cs +++ b/src/KubernetesClient/Kubernetes.ConfigInit.cs @@ -26,7 +26,11 @@ public Kubernetes(KubernetesClientConfiguration config, params DelegatingHandler if (config.SslCaCerts != null) { - CaCerts = new X509Certificate2Collection(config.SslCaCerts.Select(c => new X509Certificate2(c)).ToArray()); + var caCerts = new X509Certificate2Collection(); + foreach (var cert in config.SslCaCerts) + { + caCerts.Add(new X509Certificate2(cert)); + } } SkipTlsVerify = config.SkipTlsVerify; @@ -35,9 +39,9 @@ public Kubernetes(KubernetesClientConfiguration config, params DelegatingHandler InitializeFromConfig(config); HttpClientTimeout = config.HttpClientTimeout; jsonSerializerOptions = config.JsonSerializerOptions; - #if NETSTANDARD2_1_OR_GREATER || NET5_0_OR_GREATER +#if NETSTANDARD2_1_OR_GREATER || NET5_0_OR_GREATER DisableHttp2 = config.DisableHttp2; - #endif +#endif } private void ValidateConfig(KubernetesClientConfiguration config)