AspNetCore.Diagnostics.HealthChecks icon indicating copy to clipboard operation
AspNetCore.Diagnostics.HealthChecks copied to clipboard

HealthCheck docker container unable to connect to services with self-signed ssl certificates

Open Luk164 opened this issue 9 months ago • 1 comments

Please, fill the following sections to help us fix the issue

What happened: When I try to connect to another docker container that is using ssl I get the following error:

GetHealthReport threw an exception when trying to get report from https://my_container:5003/health-report-ui configured with name firstTest.
      System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.

       ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid because of errors in the certificate chain: PartialChain
...

What you expected to happen: The health check works as expected.

How to reproduce it (as minimally and precisely as possible):

  1. Create a project using with the health-check API with a self-signed SSL certificate
  2. deploy
  3. Try to connect to it using the docker container version of health check UI

Anything else we need to know?: I understand that som may want to check if the certificate is valid as well but a setting to turn it off would go a long way.

Environment:

  • .NET Core version: 9
  • Healthchecks version: 9.0.0
  • Operative system: Windows 10/Rancher
  • Others:

Luk164 avatar May 14 '25 15:05 Luk164

I think https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/issues/289 approach could be used, toggled by an env variable

Luk164 avatar May 14 '25 15:05 Luk164