Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion iotc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import json
from utime import time,sleep
import gc
import ssl
try:
from umqtt.robust import MQTTClient
except:
Expand Down Expand Up @@ -103,7 +104,7 @@ def connect(self):
self._id_scope, self._device_id, self._credentials_type,self._credentials,self._logger,self._model_id)
creds = prov.register()
self._mqtt_client = MQTTClient(self._device_id, creds.host, 8883, creds.user.encode(
'utf-8'), creds.password.encode('utf-8'), ssl=True, keepalive=60)
'utf-8'), creds.password.encode('utf-8'), ssl=ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT), keepalive=60)
self._commands_regex = ure.compile(
'\$iothub\/methods\/POST\/(.+)\/\?\$rid=(.+)')
self._mqtt_client.connect(False)
Expand Down