Adjusted default value for the supported Net frameworks versions where "None" is incompatible. (#1348)

This commit is contained in:
HansM
2022-02-17 20:00:57 +01:00
committed by GitHub
parent d5691346a9
commit 47e674e4d3
4 changed files with 19 additions and 4 deletions
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
@@ -52,7 +52,12 @@ namespace MQTTnet.Extensions.WebSocket4Net
}
}
var sslProtocols = _webSocketOptions?.TlsOptions?.SslProtocol ?? SslProtocols.None;
#if NET48 || NETCOREAPP3_1 || NET5 || NET6
var sslProtocols = _webSocketOptions?.TlsOptions.SslProtocol ?? SslProtocols.Tls12 | SslProtocols.Tls13;
#else
var sslProtocols = _webSocketOptions?.TlsOptions.SslProtocol ?? SslProtocols.Tls12 | (SslProtocols)0x00003000 /*Tls13*/;
#endif
var subProtocol = _webSocketOptions.SubProtocols.FirstOrDefault() ?? string.Empty;
var cookies = new List<KeyValuePair<string, string>>();