# Machinebeat MQTT module: SSL connection to broker fails

**URL:** <https://discuss.elastic.co/t/machinebeat-mqtt-module-ssl-connection-to-broker-fails/206369>\
**Category:** Beats\
**Created:** [November 4, 2019, 10:36am UTC](https://discuss.elastic.co/t/machinebeat-mqtt-module-ssl-connection-to-broker-fails/206369 "2019-11-04T10:36:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gmackers](https://avatars.discourse-cdn.com/v4/letter/g/4491bb/32.png) [@gmackers](https://discuss.elastic.co/u/gmackers)\
**Post date:** [November 4, 2019, 10:36am UTC](https://discuss.elastic.co/t/machinebeat-mqtt-module-ssl-connection-to-broker-fails/206369/1 "2019-11-04T10:36:13Z")

</div>

Hi,

I'm trying out the MQTT module of the machinebeat beta after reading about it here: [[https://www.elastic.co/blog/industrial-internet-of-things-iiot-with-the-elastic-stack](https://www.elastic.co/blog/industrial-internet-of-things-iiot-with-the-elastic-stack)] and I'm having a problem connecting to an MQTT broker using SSL (port 8883). I have specified the cert file paths (.pem format) in the module config, and I can use the same files to connect successfully to the broker using nodejs (node-red) and other MQTT clients.

In the machinebeat logs I get:

2019-11-04T23:33:20.933+1300 INFO instance/beat.go:416 machinebeat start running.  
2019-11-04T23:33:20.933+1300 INFO [monitoring] log/log.go:117 Starting metrics logging every 30s  
2019-11-04T23:33:20.933+1300 DEBUG [service] service/service\_windows.go:72 Windows is interactive: true  
2019-11-04T23:33:20.934+1300 DEBUG [cfgfile] cfgfile/reload.go:123 Checking module configs from: c:\elk\machinebeat/modules.d/\*.yml  
2019-11-04T23:33:20.937+1300 DEBUG [cfgfile] cfgfile/cfgfile.go:175 Load config from file: c:\elk\machinebeat\modules.d\mqtt.yml  
2019-11-04T23:33:20.937+1300 DEBUG [cfgfile] cfgfile/reload.go:137 Number of module configs found: 1  
2019-11-04T23:33:20.938+1300 WARN [cfgwarn] topic/mqtt.go:55 BETA: The MQTT metricset is beta.  
2019-11-04T23:33:20.938+1300 INFO topic/client.go:72 [MQTT] Connect to broker URL: localhost:8883  
2019-11-04T23:33:20.938+1300 INFO topic/client.go:85 [MQTT] Broker username: test  
2019-11-04T23:33:20.939+1300 INFO topic/client.go:94 [MQTT] Configure session to use SSL  
2019-11-04T23:33:20.942+1300 INFO topic/client.go:33 [MQTT] Set the CA  
2019-11-04T23:33:20.943+1300 INFO topic/client.go:56 [MQTT] Set the Certs  
2019-11-04T23:33:20.950+1300 INFO topic/client.go:107 Failed to connect to broker, waiting 5 seconds and retrying

In the MQTT broker (mosquitto) logs I get:

1572863269: OpenSSL Error: error:140260FC:SSL routines:ACCEPT\_SR\_CLNT\_HELLO:unknown protocol  
1572863269: Socket error on client , disconnecting.

Anyone have any ideas on how I can troubleshoot this issue in more depth?

Thanks,  
gmackers

---

<div class="post-metadata">

**Author:** ![Felix\_Roessel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felix_roessel/32/41623_2.png) [@Felix\_Roessel](https://discuss.elastic.co/u/Felix_Roessel)\
**Post date:** [November 5, 2019, 8:16am UTC](https://discuss.elastic.co/t/machinebeat-mqtt-module-ssl-connection-to-broker-fails/206369/2 "2019-11-05T08:16:19Z")

</div>

> [@gmackers](#):
>
> mosquitto

Hi gmackers,

lets handle that in the github issue you have opened: [MQTT module: SSL connection fails · Issue #4 · elastic/Machinebeat · GitHub](https://github.com/elastic/Machinebeat/issues/4)

Best regards  
Felix

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 2, 2019, 10:36am UTC](https://discuss.elastic.co/t/machinebeat-mqtt-module-ssl-connection-to-broker-fails/206369/3 "2019-12-02T10:36:15Z")

</div>

This topic was automatically closed after 28 days. New replies are no longer allowed.
