mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-11-04 13:33:02 +08:00
let the OS choose the supported TLS ptotocols when connecting to a MQTT broker (#1271)
This commit is contained in:
@@ -19,11 +19,7 @@ namespace MQTTnet.Client.Options
|
|||||||
|
|
||||||
public Func<MqttClientCertificateValidationCallbackContext, bool> CertificateValidationHandler { get; set; }
|
public Func<MqttClientCertificateValidationCallbackContext, bool> CertificateValidationHandler { get; set; }
|
||||||
|
|
||||||
#if NETCOREAPP3_1 || NET5_0
|
public SslProtocols SslProtocol { get; set; } = SslProtocols.None;
|
||||||
public SslProtocols SslProtocol { get; set; } = SslProtocols.Tls13;
|
|
||||||
#else
|
|
||||||
public SslProtocols SslProtocol { get; set; } = SslProtocols.Tls12;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if WINDOWS_UWP
|
#if WINDOWS_UWP
|
||||||
public IEnumerable<IEnumerable<byte>> Certificates { get; set; }
|
public IEnumerable<IEnumerable<byte>> Certificates { get; set; }
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Security;
|
using System.Net.Security;
|
||||||
using System.Security.Authentication;
|
using System.Security.Authentication;
|
||||||
@@ -26,11 +26,7 @@ namespace MQTTnet.Client.Options
|
|||||||
public List<SslApplicationProtocol> ApplicationProtocols { get; set; }
|
public List<SslApplicationProtocol> ApplicationProtocols { get; set; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if NETCOREAPP3_1 || NET5_0
|
public SslProtocols SslProtocol { get; set; } = SslProtocols.None;
|
||||||
public SslProtocols SslProtocol { get; set; } = SslProtocols.Tls13;
|
|
||||||
#else
|
|
||||||
public SslProtocols SslProtocol { get; set; } = SslProtocols.Tls12;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
[Obsolete("This property will be removed soon. Use CertificateValidationHandler instead.")]
|
[Obsolete("This property will be removed soon. Use CertificateValidationHandler instead.")]
|
||||||
public Func<X509Certificate, X509Chain, SslPolicyErrors, IMqttClientOptions, bool> CertificateValidationCallback { get; set; }
|
public Func<X509Certificate, X509Chain, SslPolicyErrors, IMqttClientOptions, bool> CertificateValidationCallback { get; set; }
|
||||||
|
|||||||
Reference in New Issue
Block a user