mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-16 17:23:04 +08:00
Remove TLS support for UWP servers because Framework does not support it.
This commit is contained in:
@@ -8,7 +8,7 @@ namespace MQTTnet.Core.Client
|
||||
|
||||
public int? Port { get; set; }
|
||||
|
||||
public MqttClientSslOptions SslOptions { get; } = new MqttClientSslOptions();
|
||||
public MqttClientTlsOptions TlsOptions { get; } = new MqttClientTlsOptions();
|
||||
|
||||
public string UserName { get; set; }
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace MQTTnet.Core.Client
|
||||
return options.Port.Value;
|
||||
}
|
||||
|
||||
return !options.SslOptions.UseSsl ? 1883 : 8883;
|
||||
return !options.TlsOptions.UseTls ? 1883 : 8883;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace MQTTnet.Core.Client
|
||||
{
|
||||
public sealed class MqttClientSslOptions
|
||||
public sealed class MqttClientTlsOptions
|
||||
{
|
||||
public bool UseSsl { get; set; }
|
||||
public bool UseTls { get; set; }
|
||||
|
||||
public bool CheckCertificateRevocation { get; set; }
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace MQTTnet.Core.Server
|
||||
{
|
||||
public DefaultEndpointOptions DefaultEndpointOptions { get; } = new DefaultEndpointOptions();
|
||||
|
||||
public SslEndpointOptions SslEndpointOptions { get; } = new SslEndpointOptions();
|
||||
public MqttServerTlsEndpointOptions TlsEndpointOptions { get; } = new MqttServerTlsEndpointOptions();
|
||||
|
||||
public int ConnectionBacklog { get; set; } = 10;
|
||||
|
||||
|
||||
@@ -4,16 +4,16 @@ namespace MQTTnet.Core.Server
|
||||
{
|
||||
public static class MqttServerOptionsExtensions
|
||||
{
|
||||
public static int GetSslEndpointPort(this MqttServerOptions options)
|
||||
public static int GetTlsEndpointPort(this MqttServerOptions options)
|
||||
{
|
||||
if (options == null) throw new ArgumentNullException(nameof(options));
|
||||
|
||||
if (!options.SslEndpointOptions.Port.HasValue)
|
||||
if (!options.TlsEndpointOptions.Port.HasValue)
|
||||
{
|
||||
return 8883;
|
||||
}
|
||||
|
||||
return options.SslEndpointOptions.Port.Value;
|
||||
return options.TlsEndpointOptions.Port.Value;
|
||||
}
|
||||
|
||||
public static int GetDefaultEndpointPort(this MqttServerOptions options)
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
namespace MQTTnet.Core.Server
|
||||
{
|
||||
public sealed class SslEndpointOptions
|
||||
public sealed class MqttServerTlsEndpointOptions
|
||||
{
|
||||
public bool IsEnabled { get; set; }
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace MQTTnet.Core.Server
|
||||
{
|
||||
public static class SslEndpointOptionsExtensions
|
||||
public static class MqttServerTlsEndpointOptionsExtensions
|
||||
{
|
||||
public static int GetPort(this DefaultEndpointOptions options)
|
||||
{
|
||||
Reference in New Issue
Block a user