Changed server crentials property name from password to certificateCredentials

This commit is contained in:
Craig Lutgen
2019-08-08 13:35:14 -05:00
parent 9d63500f95
commit 59d2a8e551
3 changed files with 4 additions and 4 deletions
@@ -48,7 +48,7 @@ namespace MQTTnet.Implementations
throw new ArgumentException("TLS certificate is not set."); throw new ArgumentException("TLS certificate is not set.");
} }
var tlsCertificate = new X509Certificate2(options.TlsEndpointOptions.Certificate, options.TlsEndpointOptions.Password.Password); var tlsCertificate = new X509Certificate2(options.TlsEndpointOptions.Certificate, options.TlsEndpointOptions.CertificateCredentials.Password);
if (!tlsCertificate.HasPrivateKey) if (!tlsCertificate.HasPrivateKey)
{ {
throw new InvalidOperationException("The certificate for TLS encryption must contain the private key."); throw new InvalidOperationException("The certificate for TLS encryption must contain the private key.");
@@ -82,10 +82,10 @@ namespace MQTTnet.Server
return this; return this;
} }
public MqttServerOptionsBuilder WithEncryptionCertificate(byte[] value, IMqttServerCredentials password = null) public MqttServerOptionsBuilder WithEncryptionCertificate(byte[] value, IMqttServerCredentials credentials = null)
{ {
_options.TlsEndpointOptions.Certificate = value; _options.TlsEndpointOptions.Certificate = value;
_options.TlsEndpointOptions.Password = password; _options.TlsEndpointOptions.CertificateCredentials = credentials;
return this; return this;
} }
@@ -12,7 +12,7 @@ namespace MQTTnet.Server
public byte[] Certificate { get; set; } public byte[] Certificate { get; set; }
public IMqttServerCredentials Password { get; set; } public IMqttServerCredentials CertificateCredentials { get; set; }
public bool ClientCertificateRequired { get; set; } public bool ClientCertificateRequired { get; set; }