You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm on OSX targeting netcoreapp2.0 and trying to make any API call:
class Program {
static void Main(string[] args)
{
var config = KubernetesClientConfiguration.BuildConfigFromConfigFile();
var client = new Kubernetes(config);
foreach (var item in client.ListPodForAllNamespaces().Items) {
Console.WriteLine(item.Metadata.Name);
}
}
}
Generates this error:
System.PlatformNotSupportedException: The handler does not support custom handling of certificates with this combination of libcurl (7.54.0) and its SSL backend ("LibreSSL/2.0.20").
It looks like it might get sorted in .NET Core 2.1 according to this. In the meantime, I ended up creating a custom DelegatingHandler and passing it in while instantiating a new Kubernetes object:
class Program {
static void Main(string[] args)
{
var config = KubernetesClientConfiguration.BuildConfigFromConfigFile();
var client = new Kubernetes(config, new InSecureHandler());
foreach (var item in client.ListPodForAllNamespaces().Items) {
Console.WriteLine(item.Metadata.Name);
}
}
}
class InSecureHandler : DelegatingHandler {
protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) {
var handler = new HttpClientHandler {
ServerCertificateCustomValidationCallback =
HttpClientHandler.DangerousAcceptAnyServerCertificateValidator
};
InnerHandler = handler;
return await base.SendAsync(request, cancellationToken);
}
}
Just thought I'd share in case others were running into similar issues. Anyone aware of other ways of managing this problem for local development use cases ?
The text was updated successfully, but these errors were encountered:
Hi there Everyone,
I'm on OSX targeting netcoreapp2.0 and trying to make any API call:
Generates this error:
It looks like it might get sorted in .NET Core 2.1 according to this. In the meantime, I ended up creating a custom DelegatingHandler and passing it in while instantiating a new Kubernetes object:
...and that works for me:
Just thought I'd share in case others were running into similar issues. Anyone aware of other ways of managing this problem for local development use cases ?
The text was updated successfully, but these errors were encountered: