Expose server certificate password and client certificate options to MqttServerOptionsBuilder

This commit is contained in:
Craig Lutgen
2019-07-31 13:04:03 -05:00
parent 413daee551
commit a03bdc7616
5 changed files with 27 additions and 3 deletions
@@ -48,7 +48,7 @@ namespace MQTTnet.Implementations
throw new ArgumentException("TLS certificate is not set.");
}
var tlsCertificate = new X509Certificate2(options.TlsEndpointOptions.Certificate);
var tlsCertificate = new X509Certificate2(options.TlsEndpointOptions.Certificate, options.TlsEndpointOptions.Password.Password);
if (!tlsCertificate.HasPrivateKey)
{
throw new InvalidOperationException("The certificate for TLS encryption must contain the private key.");