mirror of
https://github.com/RRQM/TouchSocket.git
synced 2025-12-17 17:06:45 +08:00
发布:3.1.16
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<Project>
|
||||
|
||||
<PropertyGroup>
|
||||
<BaseVersion>3.1.15</BaseVersion>
|
||||
<BaseVersion>3.1.16</BaseVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)'=='Release'">
|
||||
<TouchSocketVersion>$(BaseVersion)</TouchSocketVersion>
|
||||
|
||||
@@ -930,9 +930,7 @@ public static class SystemExtension
|
||||
public static async Task WriteAsync(this Stream stream, ReadOnlyMemory<byte> memory, CancellationToken token)
|
||||
{
|
||||
var segment = memory.GetArray();
|
||||
|
||||
await stream.WriteAsync(segment.Array, segment.Offset, segment.Count, token)
|
||||
.ConfigureAwait(EasyTask.ContinueOnCapturedContext);
|
||||
await stream.WriteAsync(segment.Array, segment.Offset, segment.Count, token).ConfigureAwait(EasyTask.ContinueOnCapturedContext);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -24,14 +24,7 @@ public class ClientSslOption : SslOption
|
||||
/// </summary>
|
||||
public ClientSslOption()
|
||||
{
|
||||
// 初始化一个X509证书存储,用于读取和验证根证书
|
||||
var store = new X509Store(StoreName.Root);
|
||||
// 打开证书存储,允许读写操作
|
||||
store.Open(OpenFlags.ReadWrite);
|
||||
// 将证书存储中的所有证书赋值给客户端证书属性
|
||||
this.ClientCertificates = store.Certificates;
|
||||
// 关闭证书存储
|
||||
store.Close();
|
||||
this.ClientCertificates = new X509Certificate2Collection();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -46,7 +46,7 @@ public abstract class SslOption
|
||||
/// <summary>
|
||||
/// 协议版本
|
||||
/// </summary>
|
||||
public SslProtocols SslProtocols { get; set; }
|
||||
public SslProtocols SslProtocols { get; set; } = SslProtocols.None;
|
||||
|
||||
/// <summary>
|
||||
/// 该值指定身份验证期间是否检查证书吊销列表
|
||||
|
||||
@@ -264,16 +264,8 @@ public static class TouchSocketConfigExtension
|
||||
{
|
||||
config.SetClientSslOption(new ClientSslOption()
|
||||
{
|
||||
TargetHost = value.Authority,
|
||||
#if NET45 || NETSTANDARD2_0
|
||||
SslProtocols = SslProtocols.Ssl2 | SslProtocols.Ssl3 | SslProtocols.Tls | SslProtocols.Tls11 | SslProtocols.Tls12
|
||||
#elif NET481_OR_GREATER
|
||||
SslProtocols = SslProtocols.Ssl2 | SslProtocols.Ssl3 | SslProtocols.Tls | SslProtocols.Tls11 | SslProtocols.Tls12 | SslProtocols.Tls13
|
||||
#elif NET6_0
|
||||
SslProtocols = SslProtocols.Tls | SslProtocols.Tls11 | SslProtocols.Tls12 | SslProtocols.Tls13
|
||||
#elif NET7_0_OR_GREATER
|
||||
SslProtocols = SslProtocols.Tls12 | SslProtocols.Tls13
|
||||
#endif
|
||||
TargetHost = value.Host,
|
||||
SslProtocols= SslProtocols.None
|
||||
});
|
||||
}
|
||||
return config;
|
||||
|
||||
Reference in New Issue
Block a user