diff --git a/Source/MQTTnet/Implementations/MqttTcpServerListener.cs b/Source/MQTTnet/Implementations/MqttTcpServerListener.cs index 62eea00..fe0e792 100644 --- a/Source/MQTTnet/Implementations/MqttTcpServerListener.cs +++ b/Source/MQTTnet/Implementations/MqttTcpServerListener.cs @@ -160,7 +160,7 @@ namespace MQTTnet.Implementations if (_tlsCertificate != null) { - var sslStream = new SslStream(stream, false); + var sslStream = new SslStream(stream, false, _tlsOptions.RemoteCertificateValidationCallback); await sslStream.AuthenticateAsServerAsync( _tlsCertificate, diff --git a/Source/MQTTnet/Server/MqttServerTlsTcpEndpointOptions.cs b/Source/MQTTnet/Server/MqttServerTlsTcpEndpointOptions.cs index 212b052..3e787ed 100644 --- a/Source/MQTTnet/Server/MqttServerTlsTcpEndpointOptions.cs +++ b/Source/MQTTnet/Server/MqttServerTlsTcpEndpointOptions.cs @@ -1,4 +1,5 @@ -using System.Security.Authentication; +using System.Net.Security; +using System.Security.Authentication; namespace MQTTnet.Server { @@ -14,7 +15,9 @@ namespace MQTTnet.Server public bool ClientCertificateRequired { get; set; } public bool CheckCertificateRevocation { get; set; } - + + public RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; set; } + public SslProtocols SslProtocol { get; set; } = SslProtocols.Tls12; } }