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;
});
}
}

View File

@@ -1,10 +1,11 @@
using Dlhis.Dh.Api.Requests;
using Dlhis.Dh.Api.Clients;
using Dlhis.Dh.Api.Requests;
using Dlhis.Dh.Api.ResultHandlers;
using Kurisu.RemoteCall.Attributes;
namespace Dlhis.Dh.Api;
[EnableRemoteClient(Name = "dh-service", BaseUrl = "https://10.32.0.100")]
[EnableRemoteClient(Name = "dh-service", BaseUrl = "https://10.32.0.100", PolicyHandler = typeof(DhClientHandler))]
public interface IDhApi
{
[Post("/evo-apigw/evo-visitor/1.0.0/card/visitor/custom-face")]