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:
@@ -7,9 +7,7 @@ using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Net.WebSockets;
|
||||
#if (NET452 || NETSTANDARD2_0)
|
||||
using System.Net.Security;
|
||||
#endif
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
@@ -297,11 +295,7 @@ namespace k8s
|
||||
}
|
||||
|
||||
// Set Credentials
|
||||
#if NET452
|
||||
foreach (var cert in ((WebRequestHandler)this.HttpClientHandler).ClientCertificates.OfType<X509Certificate2>())
|
||||
#else
|
||||
foreach (var cert in HttpClientHandler.ClientCertificates.OfType<X509Certificate2>())
|
||||
#endif
|
||||
foreach (var cert in this.HttpClientHandler.ClientCertificates.OfType<X509Certificate2>())
|
||||
{
|
||||
webSocketBuilder.AddClientCertificate(cert);
|
||||
}
|
||||
@@ -318,14 +312,14 @@ namespace k8s
|
||||
}
|
||||
}
|
||||
|
||||
#if (NET452 || NETSTANDARD2_0)
|
||||
if (CaCerts != null)
|
||||
#if (NETSTANDARD2_0)
|
||||
if (this.CaCerts != null)
|
||||
{
|
||||
webSocketBuilder.SetServerCertificateValidationCallback(ServerCertificateValidationCallback);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if NETCOREAPP2_1
|
||||
#if NETSTANDARD2_1
|
||||
if (this.CaCerts != null)
|
||||
{
|
||||
webSocketBuilder.ExpectServerCertificate(this.CaCerts);
|
||||
@@ -340,7 +334,7 @@ namespace k8s
|
||||
{
|
||||
webSocketBuilder.Options.AddSubProtocol(webSocketSubProtocol);
|
||||
}
|
||||
#endif // NETCOREAPP2_1
|
||||
#endif // NETSTANDARD2_1
|
||||
|
||||
// Send Request
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
@@ -412,8 +406,8 @@ namespace k8s
|
||||
ServiceClientTracing.Exit(invocationId, null);
|
||||
}
|
||||
|
||||
#if (NET452 || NETSTANDARD2_0)
|
||||
if (CaCerts != null)
|
||||
#if (NETSTANDARD2_0)
|
||||
if (this.CaCerts != null)
|
||||
{
|
||||
webSocketBuilder.CleanupServerCertificateValidationCallback(
|
||||
ServerCertificateValidationCallback);
|
||||
@@ -424,7 +418,7 @@ namespace k8s
|
||||
return webSocket;
|
||||
}
|
||||
|
||||
#if (NET452 || NETSTANDARD2_0)
|
||||
#if (NETSTANDARD2_0)
|
||||
internal bool ServerCertificateValidationCallback(object sender, X509Certificate certificate, X509Chain chain,
|
||||
SslPolicyErrors sslPolicyErrors)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user