Skip to content

Commit ed4d2ae

Browse files
committed
use TLS when possible
1 parent 5f3fc07 commit ed4d2ae

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

examples/cpython/minimqtt_adafruitio_cpython.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
22
# SPDX-License-Identifier: MIT
33

4-
import time
54
import socket
5+
import ssl
6+
import time
7+
68
import adafruit_minimqtt.adafruit_minimqtt as MQTT
79

810
### Secrets File Setup ###
@@ -50,6 +52,8 @@ def message(client, topic, message):
5052
username=secrets["aio_username"],
5153
password=secrets["aio_key"],
5254
socket_pool=socket,
55+
is_ssl=True,
56+
ssl_context=ssl.create_default_context()
5357
)
5458

5559
# Setup the callback methods above

0 commit comments

Comments
 (0)