full clone cacert from config object (#1437)

* full clone cacert from config ojb

* happy net48

* blame copilot
This commit is contained in:
Boshi Lian
2023-10-26 09:24:04 -07:00
committed by GitHub
parent f55d1faf31
commit 4f3415d9cb

View File

@@ -23,7 +23,18 @@ namespace k8s
{
Initialize();
ValidateConfig(config);
CaCerts = config.SslCaCerts;
if (config.SslCaCerts != null)
{
var caCerts = new X509Certificate2Collection();
foreach (var cert in config.SslCaCerts)
{
caCerts.Add(new X509Certificate2(cert));
}
CaCerts = caCerts;
}
SkipTlsVerify = config.SkipTlsVerify;
TlsServerName = config.TlsServerName;
CreateHttpClient(handlers, config);