mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2025-04-05 17:37:54 +08:00
feat(tenpayv2): adapt to .NET 9.0
This commit is contained in:
parent
9644cf016f
commit
ac34f57fd6
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net462; net471; netstandard2.0; net6.0</TargetFrameworks>
|
||||
<TargetFrameworks>net462; net471; netstandard2.0; net6.0; net9.0</TargetFrameworks>
|
||||
<LangVersion>10.0</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
<NullableReferenceTypes>true</NullableReferenceTypes>
|
||||
|
@ -28,6 +28,9 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV2.Settings
|
||||
{
|
||||
X509Certificate x509;
|
||||
|
||||
#if NET9_0_OR_GREATER
|
||||
x509 = X509CertificateLoader.LoadPkcs12(certificateBytes, certificatePassword, X509KeyStorageFlags.UserKeySet | X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet);
|
||||
#else
|
||||
#if NET471_OR_GREATER || NETCOREAPP2_1_OR_GREATER || NET5_0_OR_GREATER
|
||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||
#else
|
||||
@ -44,6 +47,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV2.Settings
|
||||
? new X509Certificate2(certificateBytes)
|
||||
: new X509Certificate2(certificateBytes, certificatePassword, X509KeyStorageFlags.UserKeySet | X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if NETCOREAPP2_1_OR_GREATER || NET5_0_OR_GREATER
|
||||
handler.SslOptions.ClientCertificates = new X509CertificateCollection() { x509 };
|
||||
|
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net472; net6.0</TargetFrameworks>
|
||||
<TargetFrameworks>net472; net6.0; net9.0</TargetFrameworks>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
<NullableReferenceTypes>true</NullableReferenceTypes>
|
||||
|
Loading…
Reference in New Issue
Block a user