# Connection failed to broker:mqtt and node-red

**URL:** <https://discourse.nodered.org/t/connection-failed-to-broker-mqtt-and-node-red/40721>\
**Category:** General\
**Created:** [10 February 2021 06:38 UTC](https://discourse.nodered.org/t/connection-failed-to-broker-mqtt-and-node-red/40721 "2021-02-10T06:38:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ravi071213](https://avatars.discourse-cdn.com/v4/letter/r/b9bd4f/32.png) [@ravi071213](https://discourse.nodered.org/u/ravi071213)\
**Post date:** [10 February 2021 06:38 UTC](https://discourse.nodered.org/t/connection-failed-to-broker-mqtt-and-node-red/40721/1 "2021-02-10T06:38:38Z")

</div>

hello everyone,  
i have installed mosquitto broker and node-red on my pc  
using mosquitto broker i am able to sub to topics and i am able to publish mesaageson the topic  
however when i am ooening node-red on local host and deploying mqtt pallete error message is being generated in command line that connection to bro

> Blockquote

10 Feb 11:42:04 - [info] Starting flows  
10 Feb 11:42:04 - [info] Started flows

- Building index.html...10 Feb 11:42:04 - [info] [mqtt-broker:mqtt] Connection failed to broker: mqtts://localhost:1883  
| Building index.js...10 Feb 11:42:19 - [info] [mqtt-broker:mqtt] Connection failed to broker: mqtts://localhost:1883

> Blockquote

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [10 February 2021 07:13 UTC](https://discourse.nodered.org/t/connection-failed-to-broker-mqtt-and-node-red/40721/2 "2021-02-10T07:13:10Z")

</div>

Welcome to the forum @ravi071213

> [@ravi071213](#):
>
> Connection failed to broker: mqtts://localhost:1883

The clue is that says mqtts instead of mqtt. That suggests that you have configured the broker node. I am not at my computer so can't check exactly what the settings are but look for the word secure or/and TLS and make sure you haven't selected it

---

<div class="post-metadata">

**Author:** ![ravi071213](https://avatars.discourse-cdn.com/v4/letter/r/b9bd4f/32.png) [@ravi071213](https://discourse.nodered.org/u/ravi071213)\
**Post date:** [10 February 2021 07:54 UTC](https://discourse.nodered.org/t/connection-failed-to-broker-mqtt-and-node-red/40721/3 "2021-02-10T07:54:15Z")

</div>

It will be very helpful if you can provide a solution to this...I am all stuck in my project

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [10 February 2021 08:07 UTC](https://discourse.nodered.org/t/connection-failed-to-broker-mqtt-and-node-red/40721/4 "2021-02-10T08:07:13Z")

</div>

How exactly have you configured the mqtt node? As Colin says, it looks like you have configured it to use TLS/mqtts - the solution is to change it to not use TLS.

---

<div class="post-metadata">

**Author:** ![ravi071213](https://avatars.discourse-cdn.com/v4/letter/r/b9bd4f/32.png) [@ravi071213](https://discourse.nodered.org/u/ravi071213)\
**Post date:** [10 February 2021 08:14 UTC](https://discourse.nodered.org/t/connection-failed-to-broker-mqtt-and-node-red/40721/5 "2021-02-10T08:14:27Z")

</div>

Thanks a lot Collin it helped...all working now

---

<div class="post-metadata">

**Author:** ![ravi071213](https://avatars.discourse-cdn.com/v4/letter/r/b9bd4f/32.png) [@ravi071213](https://discourse.nodered.org/u/ravi071213)\
**Post date:** [10 February 2021 14:24 UTC](https://discourse.nodered.org/t/connection-failed-to-broker-mqtt-and-node-red/40721/6 "2021-02-10T14:24:57Z")

</div>

Yeah I have removed the check mark from TLS and it worked...hooray

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [24 February 2021 14:25 UTC](https://discourse.nodered.org/t/connection-failed-to-broker-mqtt-and-node-red/40721/7 "2021-02-24T14:25:33Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
