|
@@ -1,4 +1,5 @@ |
|
|
using System; |
|
|
using System; |
|
|
|
|
|
using System.Linq; |
|
|
using MQTTnet.Core.Serializer; |
|
|
using MQTTnet.Core.Serializer; |
|
|
|
|
|
|
|
|
namespace MQTTnet.Core.Client |
|
|
namespace MQTTnet.Core.Client |
|
@@ -79,6 +80,24 @@ namespace MQTTnet.Core.Client |
|
|
return this; |
|
|
return this; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public MqttClientOptionsBuilder WithTls( |
|
|
|
|
|
bool allowUntrustedCertificates = false, |
|
|
|
|
|
bool ignoreCertificateChainErrors = false, |
|
|
|
|
|
bool ignoreCertificateRevocationErrors = false, |
|
|
|
|
|
params byte[][] certificates) |
|
|
|
|
|
{ |
|
|
|
|
|
_tlsOptions = new MqttClientTlsOptions |
|
|
|
|
|
{ |
|
|
|
|
|
UseTls = true, |
|
|
|
|
|
AllowUntrustedCertificates = allowUntrustedCertificates, |
|
|
|
|
|
IgnoreCertificateChainErrors = ignoreCertificateChainErrors, |
|
|
|
|
|
IgnoreCertificateRevocationErrors = ignoreCertificateRevocationErrors, |
|
|
|
|
|
Certificates = certificates.ToList() |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
return this; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public MqttClientOptionsBuilder WithTls() |
|
|
public MqttClientOptionsBuilder WithTls() |
|
|
{ |
|
|
{ |
|
|
_tlsOptions = new MqttClientTlsOptions |
|
|
_tlsOptions = new MqttClientTlsOptions |
|
|