Add bundle certificate support (#253)

* initial

* add some comments

* cleanup

* var

* Use X509Certificate2cCollection

* add missing asset files

* address comments
This commit is contained in:
etchang
2019-03-11 06:39:28 -07:00
committed by Kubernetes Prow Robot
parent f6b58d535a
commit 9bdaf132d4
14 changed files with 202 additions and 59 deletions

View File

@@ -260,16 +260,16 @@ namespace k8s
}
#if NET452
if (this.CaCert != null)
if (this.CaCerts != null)
{
webSocketBuilder.SetServerCertificateValidationCallback(this.ServerCertificateValidationCallback);
}
#endif
#if NETCOREAPP2_1
if (this.CaCert != null)
if (this.CaCerts != null)
{
webSocketBuilder.ExpectServerCertificate(this.CaCert);
webSocketBuilder.ExpectServerCertificate(this.CaCerts);
}
if (this.SkipTlsVerify)
@@ -347,7 +347,7 @@ namespace k8s
ServiceClientTracing.Exit(invocationId, null);
}
#if NET452
if (this.CaCert != null)
if (this.CaCerts != null)
{
webSocketBuilder.CleanupServerCertificateValidationCallback(this.ServerCertificateValidationCallback);
}
@@ -359,7 +359,7 @@ namespace k8s
#if NET452
internal bool ServerCertificateValidationCallback(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
{
return Kubernetes.CertificateValidationCallBack(sender, this.CaCert, certificate, chain, sslPolicyErrors);
return Kubernetes.CertificateValidationCallBack(sender, this.CaCerts, certificate, chain, sslPolicyErrors);
}
#endif
}