raynerv / node-red-contrib-mqttssl Goto Github PK
View Code? Open in Web Editor NEWA node-red node for MQTT over SSL/TLS
A node-red node for MQTT over SSL/TLS
The package no longer seems to work as of June 2019. Here is what I get when installing, adding the required line to package.json file, and re-starting node-red:
20 Jun 19:58:43 - [info] Waiting for missing types to be registered:
20 Jun 19:58:43 - [info] - mqttssl-broker
I have the latest versions of npm, node-red, node-red-dashboard etc. Running things on Windows 10. It totally stops all flows from running.
I am unable to connect to a v1.4.2 broker using this package. Using a simple node.js application with a recent mqtt
package (v1.1.5) does connect and works as expected.
I initially thought that this issue may be caused by my usage of self-signed certificates, but later discovered that this is unrelated to the issue. It is also not a authorization issue as discussed in Issue #1.
Symptoms are when running node-red in verbose mode it shows repeated `[mqtt] [88b5cac3.774a38] connected to broker' messages, but no mqtt messages are ever received. On the broker (mosquitto) side, the logs show the following lines repeating for each connection attempt:
New connection from 192.168.0.136 on port 8883.
New client connected from 192.168.0.136 as node-red-playground (c1, k15, u'myuser').
Socket error on client node-red-playground, disconnecting.
This sounds like the problem that @VirTERM was referencing in Issue #1.
Digging into the problem for a few hours reveals that there appears to be a bug in the (extremely) old version (v0.3.x) of mqtt
referenced in this project - it sends a 'connect' command before the secure connection is completely up, which causes mosquitto to close the connection. Hand-patching the mqtt library in place to fix the issue allows me to successfully connect to the broker.
Also while looking into this issue, I found what appears to be a bug in your mqttClientPool.js
code. Around line 63 there is the line
var connecting = false;
This is causing node-red-contrib-mqttssl
to immediately generate two connections in a row when initially connecting. It also then causes the extra connection to repeatedly disconnect and reconnect while node-red is running. Setting this variable to true fixes the issue and only one connection is made and maintained.
For anyone interested in the hand-patching of the old mqtt package, I edited ./node_modules/node-red-contrib-mqttssl/node_modules/mqtt/lib/client.js
and commented out the lines:
// Send a connect packet on stream connect
this.stream.on('connect', function () {
that.conn.connect(that.options);
});
leaving the on secureConnect handler intact. Once that is removed, I am able to connect to mosquitto and receive published messages. After that, fixing the connecting
flag issue causes things to work rock-solid.
Hello, I'm trying to connect the node-red via TLS/SSL to a HiveMQ broker, using certificates. I am able to connect to the HiveMQ broker via MQTT.FX using Java Key Stores, but unable to find where to use the certificate in the MQTTSSL plugin. Is there no support for TLS and certificates, yet or am I missing something else?
Hi there,
I'm experiencing trouble connecting to the broker using name + password for authentication.
The credentials are alright, as I use them with other clients as well. Different ones (also working with other clients) don't work either. I tried that just to rule out possible ACL issues.
The broker I use is mosquitto 1.3.4 and Node-RED 0.10.4
Weird thing is: when I allow anonymous users the connection is established immediately.
Do you have a hint, where to look at to fix it?
Also username and password are not loaded, when I reconfigure the broker config node.
Any help is appreciated. Thank you.
best regards,
Ted
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.