Skip to content

CPython example not working with secure broker #62

Closed
@brentru

Description

@brentru

This library currently works with CPython sockets connecting to a insecure MQTT broker port (1883) but falls down when attempting to connect to a secure MQTT broker port (8883):

  File "/Users/brentrubell/Desktop/github_brentru/Adafruit_CircuitPython_MiniMQTT/test_cpython.py", line 63, in <module>
    mqtt_client.connect()
  File "/Users/brentrubell/Desktop/github_brentru/Adafruit_CircuitPython_MiniMQTT/adafruit_minimqtt/adafruit_minimqtt.py", line 467, in connect
    self._sock = self._get_socket(self.broker, self.port)
  File "/Users/brentrubell/Desktop/github_brentru/Adafruit_CircuitPython_MiniMQTT/adafruit_minimqtt/adafruit_minimqtt.py", line 284, in _get_socket
    sock = self._ssl_context.wrap_socket(sock, server_hostname=host)
  File "/Users/brentrubell/Desktop/github_brentru/Adafruit_CircuitPython_MiniMQTT/adafruit_minimqtt/adafruit_minimqtt.py", line 114, in wrap_socket
    return _FakeSSLSocket(socket, self._iface.TLS_MODE)
AttributeError: 'NoneType' object has no attribute 'TLS_MODE'```

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions