Tls соединение не установлено в Paho Python MQTT

def startup():
    client = mqtt.Client(client_id=" ", clean_session=True, userdata=None,transport="tcp")
    global client
    client.on_connect = on_connect
    client.on_message = on_message
    client.message_callback_add("SQT/CAP/REG/MODELNO/SLNO",send_command)
    client.message_callback_add("SQT/CAP/+/+/DAT",data_receive)
    client.username_pw_set('dave','sectorqube')

    client.tls_set(ca_certs="ssl1-master/ca.crt", certfile="ssl1-master/ca.crt, keyfile="ssl1-master/ca.key", cert_reqs=ssl.CERT_REQUIRED, tls_version=ssl.PROTOCOL_TLSv1_2, ciphers=None)
    client.connect("#",8883)
    client.loop_start()

Код не работает.

это ошибка, которую я получаю

 File "/var/www/flask_projects/iot/iot_env/lib/python3.5/site-packages/paho/mqtt/client.py", line 927, in reconnect
    sock.do_handshake()
  File "/usr/lib/python3.5/ssl.py", line 988, in do_handshake
    self._sslobj.do_handshake()
  File "/usr/lib/python3.5/ssl.py", line 633, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)

я пытаюсь подключиться по tls secure mqtt

0 ответов

Другие вопросы по тегам