Files
jinko.yikatong/Src/Dlhis.Middle/Apis/Handlers/HealthzClientHandler.cs
2024-11-14 16:24:21 +08:00

23 lines
711 B
C#

using Kurisu.RemoteCall.Abstractions;
namespace Dlhis.Middle.Apis.Handlers;
public class HealthzClientHandler : IHttpRemoteCallPolicyHandler
{
/// <inheritdoc />
public IHttpClientBuilder ConfigureHttpClient(IHttpClientBuilder builder)
{
builder.ConfigureHttpClient(client => { client.Timeout = TimeSpan.FromSeconds(10); }).ConfigurePrimaryHttpMessageHandler(() =>
{
var handler = new HttpClientHandler
{
ClientCertificateOptions = ClientCertificateOption.Manual,
ServerCertificateCustomValidationCallback = (_, _, _, _) => true
};
return handler;
});
return builder;
}
}