diff --git a/micropython/umqtt.simple/example_mqtt_tls_pub.py b/micropython/umqtt.simple/example_mqtt_tls_pub.py new file mode 100644 index 00000000..5115b454 --- /dev/null +++ b/micropython/umqtt.simple/example_mqtt_tls_pub.py @@ -0,0 +1,20 @@ +from umqtt.simple import MQTTClient + +# Test reception e.g. with: +# mosquitto_sub -t foo_topic + +def main(server="localhost"): + # NOTE: Checking server certificate is DISABLE + ssl_params = {"server_hostname": server} + c = MQTTClient("umqtt_client", + server=server, + port=8883, + user="", + password="", + keepalive=60, + ssl=True, + ssl_params=ssl_params) + + +if __name__ == "__main__": + main()