Procházet zdrojové kódy

Add options builder methods for remote certificate validation callback.

release/3.x.x
Christian Kratky před 5 roky
rodič
revize
e7ba3f76dc
3 změnil soubory, kde provedl 13 přidání a 2 odebrání
  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 Zobrazit soubor

@@ -16,6 +16,7 @@
* [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 wrong usage of socket option _NoDelay_.
* [Server] Added remote certificate validation callback (thanks to @rudacs).
* [MQTTnet.Server] Added REST API for publishing basic messages.
</releaseNotes>
<copyright>Copyright Christian Kratky 2016-2019</copyright>


+ 10
- 1
Source/MQTTnet/Server/MqttServerOptionsBuilder.cs Zobrazit soubor

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

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

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

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


+ 2
- 1
Source/MQTTnet/Server/MqttServerTlsTcpEndpointOptions.cs Zobrazit soubor

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

public bool CheckCertificateRevocation { get; set; }

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

Načítá se…
Zrušit
Uložit