Docker.DotNet: AuthenticationException: The remote certificate is invalid according to the validation procedure.
public async Task<IList<ContainerListResponse>> GetContainers()
{
ServicePointManager.ServerCertificateValidationCallback += (o, c, ch, er) => true;
var credentials = new CertificateCredentials(new X509Certificate2(@"D:\Data\key.pfx", "123456"));
ServicePointManager.ServerCertificateValidationCallback += (o, c, ch, er) => true;
var client = new DockerClientConfiguration(new System.Uri("https://192.168.0.5:2376"), credentials).CreateClient();
IList<ContainerListResponse> containers = await client.Containers.ListContainersAsync(new ContainersListParameters()
{
Limit = 10,
});
return containers;
}
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 17 (7 by maintainers)
Commits related to this issue
- Update readme to include certificate validation examples. Ref: #278 — committed to jterry75/Docker.DotNet by jterry75 6 years ago
- Update readme to include certificate validation examples. (#283) Ref: #278 — committed to dotnet/Docker.DotNet by jterry75 6 years ago
@galvesribeiro Yes, i tested IP/host and cert files with postman