mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-20 19:58:57 +08:00
Merge pull request #697 from rudacs/add-server-remove-validation-callback
Add remote certificate validation callback on server
This commit is contained in:
@@ -162,7 +162,7 @@ namespace MQTTnet.Implementations
|
|||||||
|
|
||||||
if (_tlsCertificate != null)
|
if (_tlsCertificate != null)
|
||||||
{
|
{
|
||||||
var sslStream = new SslStream(stream, false);
|
var sslStream = new SslStream(stream, false, _tlsOptions.RemoteCertificateValidationCallback);
|
||||||
|
|
||||||
await sslStream.AuthenticateAsServerAsync(
|
await sslStream.AuthenticateAsServerAsync(
|
||||||
_tlsCertificate,
|
_tlsCertificate,
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System.Security.Authentication;
|
using System.Net.Security;
|
||||||
|
using System.Security.Authentication;
|
||||||
|
|
||||||
namespace MQTTnet.Server
|
namespace MQTTnet.Server
|
||||||
{
|
{
|
||||||
@@ -14,7 +15,9 @@ namespace MQTTnet.Server
|
|||||||
public bool ClientCertificateRequired { get; set; }
|
public bool ClientCertificateRequired { get; set; }
|
||||||
|
|
||||||
public bool CheckCertificateRevocation { get; set; }
|
public bool CheckCertificateRevocation { get; set; }
|
||||||
|
|
||||||
|
public RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; set; }
|
||||||
|
|
||||||
public SslProtocols SslProtocol { get; set; } = SslProtocols.Tls12;
|
public SslProtocols SslProtocol { get; set; } = SslProtocols.Tls12;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user