diff --git a/DriverSparkplugB/DriverSparkplugB.cs b/DriverSparkplugB/DriverSparkplugB.cs index 143bd89..d8493e0 100644 --- a/DriverSparkplugB/DriverSparkplugB.cs +++ b/DriverSparkplugB/DriverSparkplugB.cs @@ -292,7 +292,7 @@ private bool ConnectTo(ConnectivityOptions c, out string errorText) } else { - if (c.caCertFile == "") + if (string.IsNullOrEmpty(c.caCertFile)) { client = new MqttClient(c.hostname, c.portnumber, true, (MqttSslProtocols)c.security, null, null); } @@ -311,7 +311,7 @@ private bool ConnectTo(ConnectivityOptions c, out string errorText) } try { - if (c.clientCertFile == null) + if (!string.IsNullOrEmpty(c.clientCertFile)) { if (c.clientCertFormat == 0) // DER {