diff --git a/Source/MQTTnet/Implementations/MqttTcpServerAdapter.cs b/Source/MQTTnet/Implementations/MqttTcpServerAdapter.cs index 8bc03904..25879bfd 100644 --- a/Source/MQTTnet/Implementations/MqttTcpServerAdapter.cs +++ b/Source/MQTTnet/Implementations/MqttTcpServerAdapter.cs @@ -48,6 +48,10 @@ namespace MQTTnet.Implementations { throw new ArgumentException("TLS certificate is not set."); } + else if (options.TlsEndpointOptions.Certificate != null && options.TlsEndpointOptions.X509Certificate != null) + { + throw new ArgumentException($"{nameof(MqttServerTlsTcpEndpointOptions.Certificate)} and {nameof(MqttServerTlsTcpEndpointOptions.X509Certificate)} cannot both be set"); + } X509Certificate2 tlsCertificate; if (options.TlsEndpointOptions.X509Certificate != null)