What is the correct way for multiple Windows containers running a .net core
application to trust each other's HTTPS certificates?
I have the following setup:
Container A
is running a REST service which is required byContainer B
Container B
calls the REST service with anHttpClient
Container B
does something with the result
The problem is, that when B
calls A
, I got a The remote certificate is invalid according to the validation procedure.
exception. This is the demo code I use:
var dummy = new HttpClient
{
BaseAddress = new Uri("https://container-a")
};
var res = await dummy.GetAsync("/api/test-endpoint");
I have no idea and did not find any useful information on how to set up the containers to trust each other. The only solution I found is to override the https trust check and this is, in my opinion, unacceptable.