fix ssl验证移除

This commit is contained in:
2024-12-26 15:19:59 +08:00
parent 684e9ab16e
commit adb9b3a981
2 changed files with 25 additions and 2 deletions

View File

@@ -0,0 +1,22 @@
using Kurisu.RemoteCall.Abstractions;
using Microsoft.Extensions.DependencyInjection;
namespace Dlhis.Dh.Api.Clients;
public class DhClientHandler : IHttpRemoteCallPolicyHandler
{
/// <inheritdoc />
public IHttpClientBuilder ConfigureHttpClient(IHttpClientBuilder builder)
{
return builder.ConfigurePrimaryHttpMessageHandler(() =>
{
var handler = new HttpClientHandler
{
ClientCertificateOptions = ClientCertificateOption.Manual,
ServerCertificateCustomValidationCallback = (_, _, _, _) => true
};
return handler;
});
}
}