Update to whom might have the same issue, in addition to korchev answer, I had to replace the below in Program.cs:
builder.Services.AddHttpClient("AppName").AddHeaderPropagation(o => o.Headers.Add("Cookie"));
With this:
builder.Services.AddHttpClient("AppName")
.ConfigurePrimaryHttpMessageHandler(() => new
HttpClientHandler()
{
ClientCertificateOptions = ClientCertificateOption.Manual,
ServerCertificateCustomValidationCallback = (httpRequestMessage, cert, cetChain, policyErrors) =>
{
return true;
}
}).AddHeaderPropagation(o => o.Headers.Add("Cookie"));
This is not secured if your website is public on the internet, but if you have an internal site with self signed certificate and you have problem with the login page, then try this.