Explorar el Código

Merge pull request #1135 from yyjdelete/framework

Add more checks for NET5_0
release/3.x.x
Christian hace 3 años
committed by GitHub
padre
commit
e5e10eee6d
No se encontró ninguna clave conocida en la base de datos para esta firma ID de clave GPG: 4AEE18F83AFDEB23
Se han modificado 7 ficheros con 9 adiciones y 21 borrados
  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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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();


Cargando…
Cancelar
Guardar