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

How can i connect to HealthChecks UI docker image with https ?

Open comm-amir-david opened this issue 4 years ago • 3 comments

i have made a docker compose with container and added the container name to the Health Checks UI like this : "https://CONTINAER NAME" but i getting error "The SSL connection could not be established, see inner exception." if i put it like this: "CONTINAER NAME" i am getting the error: "IPv4 address 0.0.0.0 and IPv6 address ::0 are unspecified addresses that cannot be used as a target address. (Parameter 'hostName')"

the docker container can be access via browser via https://localhost:5000 - UI for the checks https://localhost:5012 ports - checks client

what am i doing wrong ??

comm-amir-david avatar Dec 22 '20 11:12 comm-amir-david

+1, same proleme here

MaxThom avatar Feb 23 '21 00:02 MaxThom

I manage to solve it using Dns.GetHostName(). Your app must run on port 80 or 443 for https. Else specify the port Dns.GetHostName():3227

 setup.AddHealthCheckEndpoint(group, $"http://{Dns.GetHostName()}/healthchecks-{group}");

and when you launch your docker, you need to specify a hostname. It can be anything.
docker run -h hostname webapi On Azure WebApp for linux containers, they automaticly set a hostname.

The library is great except that lol. I hope they make a fix

MaxThom avatar Feb 24 '21 00:02 MaxThom

Hi @comm-amir-david @MaxThom

I try to review this ASAP!

unaizorrilla avatar Feb 26 '21 08:02 unaizorrilla