mirror of
https://github.com/caronc/apprise.git
synced 2024-11-25 17:44:00 +01:00
fix insecure SSL check on mqtts:// configurations (#825)
This commit is contained in:
parent
58f9e64843
commit
7bcb0647c0
@ -324,7 +324,7 @@ class NotifyMQTT(NotifyBase):
|
|||||||
ciphers=None)
|
ciphers=None)
|
||||||
|
|
||||||
# Set our TLS Verify Flag
|
# 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
|
# Establish our connection
|
||||||
if self.client.connect(
|
if self.client.connect(
|
||||||
|
@ -252,7 +252,7 @@ def test_plugin_mqtt_tls_connect_success(mqtt_client_mock):
|
|||||||
tls_version=ssl.PROTOCOL_TLS,
|
tls_version=ssl.PROTOCOL_TLS,
|
||||||
ciphers=None,
|
ciphers=None,
|
||||||
),
|
),
|
||||||
call.tls_insecure_set(True),
|
call.tls_insecure_set(False),
|
||||||
call.connect('localhost', port=8883, keepalive=30),
|
call.connect('localhost', port=8883, keepalive=30),
|
||||||
call.loop_start(),
|
call.loop_start(),
|
||||||
call.is_connected(),
|
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.
|
# Verify the right calls have been made to the MQTT client object.
|
||||||
# Let's only validate the single call of interest is present.
|
# Let's only validate the single call of interest is present.
|
||||||
# Everything else is identical with `test_plugin_mqtt_tls_connect_success`.
|
# 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):
|
def test_plugin_mqtt_session_client_id_success(mqtt_client_mock):
|
||||||
|
Loading…
Reference in New Issue
Block a user