mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-18 02:13:00 +08:00
Add exception if both Certificate and X509Certificate are set
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user