fix ssl验证移除
This commit is contained in:
22
Src/Dlhis.Dh.Api/Clients/DhClientHandler.cs
Normal file
22
Src/Dlhis.Dh.Api/Clients/DhClientHandler.cs
Normal 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;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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 Dlhis.Dh.Api.ResultHandlers;
|
||||||
using Kurisu.RemoteCall.Attributes;
|
using Kurisu.RemoteCall.Attributes;
|
||||||
|
|
||||||
namespace Dlhis.Dh.Api;
|
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
|
public interface IDhApi
|
||||||
{
|
{
|
||||||
[Post("/evo-apigw/evo-visitor/1.0.0/card/visitor/custom-face")]
|
[Post("/evo-apigw/evo-visitor/1.0.0/card/visitor/custom-face")]
|
||||||
|
|||||||
Reference in New Issue
Block a user