❔ How to implement integration test asp.net with .net 7 using client certificates ?
When i try to create an httpclient custom in a WebApplicationFactory, the test server is not running
builder.ConfigureTestServices(services =>
{
services
.AddHttpClient("client-with-certificate", client =>
{
client.BaseAddress = new Uri("https://localhost");
})
.ConfigurePrimaryHttpMessageHandler(() =>
{
var handler = new HttpClientHandler();
handler.ClientCertificates.Add(clientCertificate);
return handler;
});
});