OSError -9984

  • Trying to use SSL with MQTTClient (simple.py) gives this error. Cannot find any listing anywhere to describe it.

        client = MQTTClient(client_id="", server=host,user="",password=token,port=8883,  keepalive=0, ssl=True, ssl_params= {'cert_reqs':ssl.CERT_REQUIRED, 'ca_certs':'/flash/cert/ca.pem'})

    WLAN connection succeeded!
    Unhandled exception in thread started by <function main_loop at 0x3ffe7d50>
    Traceback (most recent call last):
    File "main.py", line 68, in main_loop
    File "simple.py", line 61, in connect
    OSError: -9984

  • That's interesting, I get that same cryptic error when I test directly over an SSL socket with a bogus certificate:

    >>> s = socket.socket()
    >>> ss = ssl.wrap_socket(s, cert_reqs=ssl.CERT_REQUIRED, ca_certs=bad_cert)
    >>> ss.connect(socket.getaddrinfo(host, 443)[0][-1])
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    OSError: -9984

    With other "wrong" certificates I've gotten OSError: [Errno -30592] MBEDTLS_ERR_SSL_FATAL_ALERT_MESSAGE instead. Not sure why the difference.

    Anyway, I know this post is old, just putting this here in case it helps someone in the future.


Log in to reply

Pycom on Twitter