mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-27 00:40:01 +08:00
Refactor server certificate classes (breaking change).
This commit is contained in:
@@ -0,0 +1,4 @@
|
|||||||
|
public interface IMqttServerCertificateCredentials
|
||||||
|
{
|
||||||
|
string Password { get; }
|
||||||
|
}
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
using System;
|
|
||||||
|
|
||||||
public interface IMqttServerCredentials
|
|
||||||
{
|
|
||||||
String Password { get; }
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
namespace MQTTnet.Server
|
||||||
|
{
|
||||||
|
public class MqttServerCertificateCredentials : IMqttServerCertificateCredentials
|
||||||
|
{
|
||||||
|
public string Password { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -82,7 +82,7 @@ namespace MQTTnet.Server
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MqttServerOptionsBuilder WithEncryptionCertificate(byte[] value, IMqttServerCredentials credentials = null)
|
public MqttServerOptionsBuilder WithEncryptionCertificate(byte[] value, IMqttServerCertificateCredentials credentials = null)
|
||||||
{
|
{
|
||||||
_options.TlsEndpointOptions.Certificate = value;
|
_options.TlsEndpointOptions.Certificate = value;
|
||||||
_options.TlsEndpointOptions.CertificateCredentials = credentials;
|
_options.TlsEndpointOptions.CertificateCredentials = credentials;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ namespace MQTTnet.Server
|
|||||||
|
|
||||||
public byte[] Certificate { get; set; }
|
public byte[] Certificate { get; set; }
|
||||||
|
|
||||||
public IMqttServerCredentials CertificateCredentials { get; set; }
|
public IMqttServerCertificateCredentials CertificateCredentials { get; set; }
|
||||||
|
|
||||||
public bool ClientCertificateRequired { get; set; }
|
public bool ClientCertificateRequired { get; set; }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user