Skip to content

Instantly share code, notes, and snippets.

@michaelklishin michaelklishin/mqtt_ssl.py Secret
Created Jun 27, 2014

Embed
What would you like to do?
#!/usr/bin/env python
import paho.mqtt.client as mqtt
def on_connect(client, userdata, flags, rc):
print("Connected with result code "+str(rc))
client.subscribe("$SYS/#")
client = mqtt.Client()
client.on_connect = on_connect
# only CA certificate
client.tls_set("/Users/antares/Tools/rabbitmq/tls/ca_certificate.pem")
# disables peer verification
client.tls_insecure_set(True)
client.connect("localhost", 8883, 60)
client.loop_forever()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.