deprecate net452 + generate model based on v1.20.0 (#536)
* remove most net452 related code * first net4 remove * migrate test proj to net5 base * fix format * update sta xunit to fix platform not support * Squashed commit of the following: commit 16e1f819058ad281e1571b356c10d4d6ce77cf38 Author: Boshi Lian <farmer1992@gmail.com> Date: Tue Dec 8 22:42:57 2020 -0800 temp disable some version converter commit 7d1a651f4e7d27d1e61c91f46f73ac8d04ea8ab9 Author: Boshi Lian <farmer1992@gmail.com> Date: Tue Dec 8 20:55:44 2020 -0800 add missing watcher generator files commit 3f3199aad269bf89406ea71d0bc63f1a7ec23245 Author: Boshi Lian <farmer1992@gmail.com> Date: Tue Dec 8 22:14:47 2020 +0000 gen v1.20.0 * bump version to 4.0 * support empty spec * fix version converter for generator * add generated header * fix warning * rerun generator
This commit is contained in:
@@ -96,19 +96,8 @@ namespace k8s
|
||||
{
|
||||
if (config.SkipTlsVerify)
|
||||
{
|
||||
#if NET452
|
||||
((WebRequestHandler)HttpClientHandler).ServerCertificateValidationCallback =
|
||||
(sender, certificate, chain, sslPolicyErrors) => true;
|
||||
#elif XAMARINIOS1_0 || MONOANDROID8_1
|
||||
System.Net.ServicePointManager.ServerCertificateValidationCallback +=
|
||||
(sender, certificate, chain, sslPolicyErrors) =>
|
||||
{
|
||||
return true;
|
||||
};
|
||||
#else
|
||||
HttpClientHandler.ServerCertificateCustomValidationCallback =
|
||||
(sender, certificate, chain, sslPolicyErrors) => true;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -116,48 +105,13 @@ namespace k8s
|
||||
{
|
||||
throw new KubeConfigException("A CA must be set when SkipTlsVerify === false");
|
||||
}
|
||||
#if NET452
|
||||
((WebRequestHandler)HttpClientHandler).ServerCertificateValidationCallback =
|
||||
(sender, certificate, chain, sslPolicyErrors) =>
|
||||
{
|
||||
return Kubernetes.CertificateValidationCallBack(sender, CaCerts, certificate, chain, sslPolicyErrors);
|
||||
};
|
||||
#elif XAMARINIOS1_0
|
||||
System.Net.ServicePointManager.ServerCertificateValidationCallback +=
|
||||
(sender, certificate, chain, sslPolicyErrors) =>
|
||||
{
|
||||
var cert
|
||||
= new X509Certificate2(certificate);
|
||||
return Kubernetes.CertificateValidationCallBack(sender, CaCerts, cert, chain, sslPolicyErrors);
|
||||
};
|
||||
#elif MONOANDROID8_1
|
||||
var certList = new System.Collections.Generic.List<Java.Security.Cert.Certificate>();
|
||||
|
||||
foreach (X509Certificate2 caCert in CaCerts)
|
||||
{
|
||||
using (var certStream
|
||||
= new System.IO.MemoryStream(caCert.RawData))
|
||||
{
|
||||
Java.Security.Cert.Certificate cert
|
||||
= Java.Security.Cert.CertificateFactory.GetInstance("X509").GenerateCertificate(certStream);
|
||||
|
||||
certList.Add(cert);
|
||||
}
|
||||
}
|
||||
|
||||
var handler
|
||||
= (Xamarin.Android.Net.AndroidClientHandler)this.HttpClientHandler;
|
||||
|
||||
handler.TrustedCerts
|
||||
= certList;
|
||||
#else
|
||||
HttpClientHandler.ServerCertificateCustomValidationCallback =
|
||||
(sender, certificate, chain, sslPolicyErrors) =>
|
||||
{
|
||||
return CertificateValidationCallBack(sender, CaCerts, certificate, chain,
|
||||
sslPolicyErrors);
|
||||
};
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,9 +126,6 @@ namespace k8s
|
||||
|
||||
partial void CustomInitialize()
|
||||
{
|
||||
#if NET452
|
||||
ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12;
|
||||
#endif
|
||||
DeserializationSettings.Converters.Add(new V1Status.V1StatusObjectViewConverter());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user