Exemple #1
0
        public MqttClientOptionsBuilder WithTls(Action <MqttClientOptionsBuilderTlsParameters> optionsBuilder)
        {
            if (optionsBuilder == null)
            {
                throw new ArgumentNullException(nameof(optionsBuilder));
            }

            _tlsParameters = new MqttClientOptionsBuilderTlsParameters
            {
                UseTls = true
            };

            optionsBuilder(_tlsParameters);
            return(this);
        }
        public MqttClientOptionsBuilder WithTls(
            bool allowUntrustedCertificates        = false,
            bool ignoreCertificateChainErrors      = false,
            bool ignoreCertificateRevocationErrors = false,
            params byte[][] certificates)
        {
            _tlsParameters = new MqttClientOptionsBuilderTlsParameters
            {
                UseTls = true,
                AllowUntrustedCertificates        = allowUntrustedCertificates,
                IgnoreCertificateChainErrors      = ignoreCertificateChainErrors,
                IgnoreCertificateRevocationErrors = ignoreCertificateRevocationErrors,
                Certificates = certificates?.ToList()
            };

            return(this);
        }
 public MqttClientOptionsBuilder WithTls(MqttClientOptionsBuilderTlsParameters parameters)
 {
     _tlsParameters = parameters ?? throw new ArgumentNullException(nameof(parameters));
     return(this);
 }
Exemple #4
0
 public MqttClientOptionsBuilder WithTls(MqttClientOptionsBuilderTlsParameters parameters)
 {
     _tlsParameters = parameters;
     return(this);
 }