I want to make a call to Kubernetes API from .NET Core app outside the cluster.
I have an HttpClient with an HttpClientHandler where I set this callback to ignore invalid (untrusted) certificates and it works:
handler.ServerCertificateCustomValidationCallback +=
(message, certificate, chain, errors) => true;
But in my kubeconfig from kubectl I have this:
...
clusters:
- cluster:
certificate-authority-data: SOME_AUTHORITY_DATA
server: https://myserver.io:443
...
How can I validate server certificate using that certificate-authority-data in my application?