Need help in talking to AWS via MQTT


Is it possible to talk to Amazon AWS IoT MQTT broker from Home Assistant?
I have modified the config file to include (the certificate files are created using AWS) :

  port: 8883
  client_id: test
  certificate: /home/homeassistant/credentials/client-certificate.crt
  client_key: /home/homeassistant/credentials/client-private-key.key
  client_cert: /home/homeassistant/credentials/ca-certificate.pem
  protocol: 3.1.1

but I got this error below:

17-04-20 17:00:03 ERROR (MainThread) [homeassistant.setup] Error during setup of
 component mqtt
Traceback (most recent call last):
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeas
sistant/", line 189, in _async_setup_component
    result = yield from component.async_setup(hass, processed_config)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeas
sistant/components/mqtt/", line 363, in async_setup
    success = yield from[DATA_MQTT].async_connect()
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/mqtt/", line 473, in async_connect
    None, self._mqttc.connect,, self.port, self.keepalive)
  File "/usr/lib/python3.4/asyncio/", line 388, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/", line 286, in _wakeup
    value = future.result()
  File "/usr/lib/python3.4/asyncio/", line 277, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/homeassistant/.homeassistant/deps/paho/mqtt/", line 704, in connect
    return self.reconnect()

I’ve checked python and ssl version, seems to be compatible with AWS requirements. What am I doing wrong?
Any help would be appreciated.

Same problema here, any update?

Part of it was my issue, I was using the wrong file for certificate, it should be the Verisign file from AWS.
The other part was the default TLS version used by HA. There’s no configuration to set TLS version, and the default ‘AUTO’ does not work with AWS IoT, so I hard coded DEFAULT_TLS_PROTOCOL to 1.2 in/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/mqtt/

Hope that helps.