forked from kubernetes-client/csharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enable websocket on netstandard (kubernetes-client#899)
* enable websocket on netstandard * happy build
- Loading branch information
Showing
5 changed files
with
52 additions
and
5 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
src/KubernetesClient.Classic/Kubernetes.Websocket.Netstandard.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System.Net.Security; | ||
using System.Security.Cryptography.X509Certificates; | ||
|
||
namespace k8s; | ||
|
||
public partial class Kubernetes | ||
{ | ||
partial void BeforeRequest() | ||
{ | ||
System.Net.ServicePointManager.ServerCertificateValidationCallback += ServerCertificateValidationCallback; | ||
} | ||
|
||
partial void AfterRequest() | ||
{ | ||
System.Net.ServicePointManager.ServerCertificateValidationCallback -= ServerCertificateValidationCallback; | ||
} | ||
|
||
private bool ServerCertificateValidationCallback(object sender, X509Certificate certificate, X509Chain chain, | ||
SslPolicyErrors sslPolicyErrors) | ||
{ | ||
if (SkipTlsVerify) | ||
{ | ||
return true; | ||
} | ||
|
||
return CertificateValidationCallBack(sender, CaCerts, certificate, chain, sslPolicyErrors); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters