mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-07-16 16:50:43 +08:00
fix(tenpayv2): 修复 .NET 4.6.X 目标框架下运行错误的问题
This commit is contained in:
parent
b451588bff
commit
02aa982641
@ -41,7 +41,6 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="SKIT.FlurlHttpClient.Common" Version="3.1.0" />
|
||||
<PackageReference Include="System.Net.Http.WinHttpHandler" Version="8.0.1" Condition="'$(TargetFramework)' == 'netstandard2.0'" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@ -15,13 +15,13 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV2.Settings
|
||||
handler.SslOptions = new SslClientAuthenticationOptions() { RemoteCertificateValidationCallback = static (_, _, _, _) => true };
|
||||
#elif NET471_OR_GREATER
|
||||
HttpClientHandler handler = new HttpClientHandler();
|
||||
handler.ServerCertificateCustomValidationCallback = static (_, _, _, sslPolicyErrors) => sslPolicyErrors == SslPolicyErrors.None;
|
||||
handler.ServerCertificateCustomValidationCallback = static (_, _, _, _) => true;
|
||||
#elif NET462_OR_GREATER
|
||||
WebRequestHandler handler = new WebRequestHandler();
|
||||
handler.ServerCertificateValidationCallback = static (_, _, _, _) => true;
|
||||
#else
|
||||
WinHttpHandler handler = new WinHttpHandler();
|
||||
handler.ServerCertificateValidationCallback = static (_, _, _, _) => true;
|
||||
HttpClientHandler handler = new HttpClientHandler();
|
||||
handler.ServerCertificateCustomValidationCallback = static (_, _, _, _) => true;
|
||||
#endif
|
||||
|
||||
if (certificateBytes is not null)
|
||||
|
Loading…
Reference in New Issue
Block a user