Browse Source

Add options builder methods for remote certificate validation callback.

release/3.x.x
Christian Kratky 5 years ago
parent
commit
e7ba3f76dc
3 changed files with 13 additions and 2 deletions
  1. +1
    -0
      Build/MQTTnet.nuspec
  2. +10
    -1
      Source/MQTTnet/Server/MqttServerOptionsBuilder.cs
  3. +2
    -1
      Source/MQTTnet/Server/MqttServerTlsTcpEndpointOptions.cs

+ 1
- 0
Build/MQTTnet.nuspec View File

@@ -16,6 +16,7 @@
* [Server] Exposed CONNECT packet properties in Application Message and Subscription interceptor. * [Server] Exposed CONNECT packet properties in Application Message and Subscription interceptor.
* [Server] Fixed: Sending Large packets with AspnetCore based connection throws System.ArgumentException. * [Server] Fixed: Sending Large packets with AspnetCore based connection throws System.ArgumentException.
* [Server] Fixed wrong usage of socket option _NoDelay_. * [Server] Fixed wrong usage of socket option _NoDelay_.
* [Server] Added remote certificate validation callback (thanks to @rudacs).
* [MQTTnet.Server] Added REST API for publishing basic messages. * [MQTTnet.Server] Added REST API for publishing basic messages.
</releaseNotes> </releaseNotes>
<copyright>Copyright Christian Kratky 2016-2019</copyright> <copyright>Copyright Christian Kratky 2016-2019</copyright>


+ 10
- 1
Source/MQTTnet/Server/MqttServerOptionsBuilder.cs View File

@@ -1,5 +1,6 @@
using System; using System;
using System.Net; using System.Net;
using System.Net.Security;
using System.Security.Authentication; using System.Security.Authentication;


namespace MQTTnet.Server namespace MQTTnet.Server
@@ -98,7 +99,15 @@ namespace MQTTnet.Server
_options.TlsEndpointOptions.IsEnabled = false; _options.TlsEndpointOptions.IsEnabled = false;
return this; return this;
} }

#if !WINDOWS_UWP
public MqttServerOptionsBuilder WithRemoteCertificateValidationCallback(RemoteCertificateValidationCallback value)
{
_options.TlsEndpointOptions.RemoteCertificateValidationCallback = value;
return this;
}
#endif

public MqttServerOptionsBuilder WithStorage(IMqttServerStorage value) public MqttServerOptionsBuilder WithStorage(IMqttServerStorage value)
{ {
_options.Storage = value; _options.Storage = value;


+ 2
- 1
Source/MQTTnet/Server/MqttServerTlsTcpEndpointOptions.cs View File

@@ -16,8 +16,9 @@ namespace MQTTnet.Server


public bool CheckCertificateRevocation { get; set; } public bool CheckCertificateRevocation { get; set; }


#if !WINDOWS_UWP
public RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; set; } public RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; set; }
#endif
public SslProtocols SslProtocol { get; set; } = SslProtocols.Tls12; public SslProtocols SslProtocol { get; set; } = SslProtocols.Tls12;
} }
} }

Loading…
Cancel
Save