Integration tests can test insecure communications with broker
This commit is contained in:
@@ -14,7 +14,7 @@ def update_client_record(client, userdata, message):
|
||||
database_blank.write("{}")
|
||||
|
||||
with open(database_file, 'r') as infile:
|
||||
database = json.load(infile)
|
||||
database = json.loads(infile.read())
|
||||
|
||||
payload = message.payload.decode('utf-8')
|
||||
response = json.loads(payload)
|
||||
@@ -25,13 +25,10 @@ def update_client_record(client, userdata, message):
|
||||
json.dump(database, outfile)
|
||||
|
||||
|
||||
def subscribe(broker_hostname, broker_port, topic="torch", ca_file=None, cert_file=None, key_file=None):
|
||||
def subscribe(broker_hostname, broker_port, topic="torch", tls=None, auth=None):
|
||||
mqtt.callback(update_client_record,
|
||||
topic,
|
||||
hostname=broker_hostname,
|
||||
port=broker_port,
|
||||
tls={
|
||||
'ca_certs': ca_file,
|
||||
'certfile': cert_file,
|
||||
'keyfile': key_file
|
||||
})
|
||||
tls=tls,
|
||||
auth=auth)
|
||||
|
||||
Reference in New Issue
Block a user