diff --git a/apprise/plugins/NotifyMQTT.py b/apprise/plugins/NotifyMQTT.py index 376264eb..48094e5f 100644 --- a/apprise/plugins/NotifyMQTT.py +++ b/apprise/plugins/NotifyMQTT.py @@ -324,7 +324,7 @@ class NotifyMQTT(NotifyBase): ciphers=None) # Set our TLS Verify Flag - self.client.tls_insecure_set(self.verify_certificate) + self.client.tls_insecure_set(not self.verify_certificate) # Establish our connection if self.client.connect( diff --git a/test/test_plugin_mqtt.py b/test/test_plugin_mqtt.py index 31147d7a..15214c79 100644 --- a/test/test_plugin_mqtt.py +++ b/test/test_plugin_mqtt.py @@ -252,7 +252,7 @@ def test_plugin_mqtt_tls_connect_success(mqtt_client_mock): tls_version=ssl.PROTOCOL_TLS, ciphers=None, ), - call.tls_insecure_set(True), + call.tls_insecure_set(False), call.connect('localhost', port=8883, keepalive=30), call.loop_start(), call.is_connected(), @@ -299,7 +299,7 @@ def test_plugin_mqtt_tls_no_verify_success(mqtt_client_mock): # Verify the right calls have been made to the MQTT client object. # Let's only validate the single call of interest is present. # Everything else is identical with `test_plugin_mqtt_tls_connect_success`. - assert call.tls_insecure_set(False) in mqtt_client_mock.mock_calls + assert call.tls_insecure_set(True) in mqtt_client_mock.mock_calls def test_plugin_mqtt_session_client_id_success(mqtt_client_mock):