我正在尝试为集成测试设置实施自定义客户端证书验证。我正在像这样使用ASP.NET Core 2.1.latest和Kestrel:
new WebHostBuilder()
.UseKestrel(
ok => ok.ConfigureHttpsDefaults(
o =>
{
o.ClientCertificateMode = ClientCertificateMode.AllowCertificate;
o.ClientCertificateValidation = RememberClientCertificate;
}))
[..]
.UseUrls("https://localhost:5051")
[..]
private static bool RememberClientCertificate (X509Certificate2 clientCertificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
{
LastClientCertificate = clientCertificate;
return true;
}
但是,从未调用过我的函数RememberClientCertificate。不管我是否发送客户证书。
我在做什么错了?