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;
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user