소스 검색

Add more checks for NET5_0

release/3.x.x
SilverFox 3 년 전
부모
커밋
e174546b5a
7개의 변경된 파일9개의 추가작업 그리고 21개의 파일을 삭제
  1. +1
    -1
      Source/MQTTnet/Client/Options/MqttClientOptionsBuilder.cs
  2. +3
    -3
      Source/MQTTnet/Client/Options/MqttClientOptionsBuilderTlsParameters.cs
  3. +1
    -1
      Source/MQTTnet/Client/Options/MqttClientTlsOptions.cs
  4. +0
    -12
      Source/MQTTnet/Implementations/MqttTcpChannel.Uwp.cs
  5. +2
    -2
      Source/MQTTnet/Implementations/MqttTcpChannel.cs
  6. +1
    -1
      Source/MQTTnet/Implementations/MqttTcpServerListener.cs
  7. +1
    -1
      Source/MQTTnet/Implementations/PlatformAbstractionLayer.cs

+ 1
- 1
Source/MQTTnet/Client/Options/MqttClientOptionsBuilder.cs 파일 보기

@@ -291,7 +291,7 @@ namespace MQTTnet.Client.Options
#pragma warning disable CS0618 // Type or member is obsolete
CertificateValidationCallback = _tlsParameters.CertificateValidationCallback,
#pragma warning restore CS0618 // Type or member is obsolete
#if NETCOREAPP3_1
#if NETCOREAPP3_1 || NET5_0
ApplicationProtocols = _tlsParameters.ApplicationProtocols,
#endif
CertificateValidationHandler = _tlsParameters.CertificateValidationHandler,


+ 3
- 3
Source/MQTTnet/Client/Options/MqttClientOptionsBuilderTlsParameters.cs 파일 보기

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Net.Security;
using System.Security.Authentication;
@@ -31,9 +31,9 @@ namespace MQTTnet.Client.Options
public IEnumerable<X509Certificate> Certificates { get; set; }
#endif

#if NETCOREAPP3_1
#if NETCOREAPP3_1 || NET5_0
public List<SslApplicationProtocol> ApplicationProtocols { get;set; }
#endif
#endif

public bool AllowUntrustedCertificates { get; set; }



+ 1
- 1
Source/MQTTnet/Client/Options/MqttClientTlsOptions.cs 파일 보기

@@ -22,7 +22,7 @@ namespace MQTTnet.Client.Options
public List<X509Certificate> Certificates { get; set; }
#endif

#if NETCOREAPP3_1
#if NETCOREAPP3_1 || NET5_0
public List<SslApplicationProtocol> ApplicationProtocols { get; set; }
#endif



+ 0
- 12
Source/MQTTnet/Implementations/MqttTcpChannel.Uwp.cs 파일 보기

@@ -75,23 +75,11 @@ namespace MQTTnet.Implementations
_socket.Control.IgnorableServerCertificateErrors.Add(ignorableChainValidationResult);
}

#if NETCOREAPP3_1 || NET5_0
var socketProtectionLevel = SocketProtectionLevel.Tls13;
if (_options.TlsOptions.SslProtocol == SslProtocols.Tls12)
{
socketProtectionLevel = SocketProtectionLevel.Tls12;
}
else if (_options.TlsOptions.SslProtocol == SslProtocols.Tls11)
{
socketProtectionLevel = SocketProtectionLevel.Tls11;
}
#else
var socketProtectionLevel = SocketProtectionLevel.Tls12;
if (_options.TlsOptions.SslProtocol == SslProtocols.Tls11)
{
socketProtectionLevel = SocketProtectionLevel.Tls11;
}
#endif
else if (_options.TlsOptions.SslProtocol == SslProtocols.Tls)
{
socketProtectionLevel = SocketProtectionLevel.Tls10;


+ 2
- 2
Source/MQTTnet/Implementations/MqttTcpChannel.cs 파일 보기

@@ -83,7 +83,7 @@ namespace MQTTnet.Implementations
var sslStream = new SslStream(networkStream, false, InternalUserCertificateValidationCallback);
try
{
#if NETCOREAPP3_1
#if NETCOREAPP3_1 || NET5_0
var sslOptions = new SslClientAuthenticationOptions
{
ApplicationProtocols = _tcpOptions.TlsOptions.ApplicationProtocols,
@@ -100,7 +100,7 @@ namespace MQTTnet.Implementations
}
catch
{
#if NETSTANDARD2_1 || NETCOREAPP3_1
#if NETSTANDARD2_1 || NETCOREAPP3_1 || NET5_0
await sslStream.DisposeAsync().ConfigureAwait(false);
#else
sslStream.Dispose();


+ 1
- 1
Source/MQTTnet/Implementations/MqttTcpServerListener.cs 파일 보기

@@ -98,7 +98,7 @@ namespace MQTTnet.Implementations
{
_socket?.Dispose();

#if NETSTANDARD1_3 || NETSTANDARD2_0 || NET461 || NET472
#if !NET452
_tlsCertificate?.Dispose();
#endif
}


+ 1
- 1
Source/MQTTnet/Implementations/PlatformAbstractionLayer.cs 파일 보기

@@ -17,7 +17,7 @@ namespace MQTTnet.Implementations

public static void Sleep(TimeSpan timeout)
{
#if NET452 || NETSTANDARD2_0 || NETSTANDARD2_1 || NETCOREAPP3_1
#if !NETSTANDARD1_3
System.Threading.Thread.Sleep(timeout);
#else
Task.Delay(timeout).Wait();


불러오는 중...
취소
저장