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