25 lines
799 B
C#
25 lines
799 B
C#
using System.Net.Http;
|
|
|
|
namespace LCU.API.Internal.Operations.IncentiveApi.Services.Dayforce;
|
|
|
|
public static class TrustingHttpClient
|
|
{
|
|
public static HttpClient GetClient(string endPoint)
|
|
{
|
|
var handler = new HttpClientHandler
|
|
{
|
|
SslProtocols = System.Security.Authentication.SslProtocols.Tls12 |
|
|
System.Security.Authentication.SslProtocols.Tls11 |
|
|
System.Security.Authentication.SslProtocols.Tls,
|
|
ServerCertificateCustomValidationCallback = (sender, cert, chain, sslPolicyErrors) => true
|
|
};
|
|
var httpClient = new HttpClient(handler)
|
|
{
|
|
Timeout = TimeSpan.FromSeconds(300),
|
|
BaseAddress = new Uri(endPoint)
|
|
};
|
|
return httpClient;
|
|
}
|
|
}
|
|
|