Kaynağa Gözat

Add options builder methods for remote certificate validation callback.

release/3.x.x
Christian Kratky 5 yıl önce
ebeveyn
işleme
e7ba3f76dc
3 değiştirilmiş dosya ile 13 ekleme ve 2 silme
  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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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;
}
}

Yükleniyor…
İptal
Kaydet