From b779d0463698edf7231af190b29b598a41d8da12 Mon Sep 17 00:00:00 2001 From: patagona Date: Sat, 23 Oct 2021 10:31:44 +0200 Subject: [PATCH] let the OS choose the supported TLS ptotocols when connecting to a MQTT broker (#1271) --- .../Options/MqttClientOptionsBuilderTlsParameters.cs | 6 +----- Source/MQTTnet/Client/Options/MqttClientTlsOptions.cs | 8 ++------ 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/Source/MQTTnet/Client/Options/MqttClientOptionsBuilderTlsParameters.cs b/Source/MQTTnet/Client/Options/MqttClientOptionsBuilderTlsParameters.cs index 9726fe0..27ad435 100644 --- a/Source/MQTTnet/Client/Options/MqttClientOptionsBuilderTlsParameters.cs +++ b/Source/MQTTnet/Client/Options/MqttClientOptionsBuilderTlsParameters.cs @@ -19,11 +19,7 @@ namespace MQTTnet.Client.Options public Func CertificateValidationHandler { get; set; } -#if NETCOREAPP3_1 || NET5_0 - public SslProtocols SslProtocol { get; set; } = SslProtocols.Tls13; -#else - public SslProtocols SslProtocol { get; set; } = SslProtocols.Tls12; -#endif + public SslProtocols SslProtocol { get; set; } = SslProtocols.None; #if WINDOWS_UWP public IEnumerable> Certificates { get; set; } diff --git a/Source/MQTTnet/Client/Options/MqttClientTlsOptions.cs b/Source/MQTTnet/Client/Options/MqttClientTlsOptions.cs index 138fabc..e2d57ee 100644 --- a/Source/MQTTnet/Client/Options/MqttClientTlsOptions.cs +++ b/Source/MQTTnet/Client/Options/MqttClientTlsOptions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Net.Security; using System.Security.Authentication; @@ -26,11 +26,7 @@ namespace MQTTnet.Client.Options public List ApplicationProtocols { get; set; } #endif -#if NETCOREAPP3_1 || NET5_0 - public SslProtocols SslProtocol { get; set; } = SslProtocols.Tls13; -#else - public SslProtocols SslProtocol { get; set; } = SslProtocols.Tls12; -#endif + public SslProtocols SslProtocol { get; set; } = SslProtocols.None; [Obsolete("This property will be removed soon. Use CertificateValidationHandler instead.")] public Func CertificateValidationCallback { get; set; }