You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The result in the console is always: Reconnecting ...
When we deploy a simple nodejs program with aedes broker in stead of the nodered application, the connection over mTLS is working.
code of the simple nodejs broker:
importAedesfrom"aedes";import{createServer}from"http";importwsfrom"websocket-stream";consthttpServer=createServer();constport=process.env.PORT||8888;constaedes=newAedes();// emitted when a client connects to the brokeraedes.on("client",function(client){console.log(`[CLIENT_CONNECTED] Client ${client ? client.id : client} connected to broker ${aedes.id}`);});// emitted when a client disconnects from the brokeraedes.on("clientDisconnect",function(client){console.log(`[CLIENT_DISCONNECTED] Client ${client ? client.id : client} disconnected from the broker ${aedes.id}`);});// emitted when a client subscribes to a message topicaedes.on("subscribe",function(subscriptions,client){console.log(`[TOPIC_SUBSCRIBED] Client ${client ? client.id : client} subscribed to topics: ${subscriptions.map((s)=>s.topic).join(",")} on broker ${aedes.id}`);});// emitted when a client unsubscribes from a message topicaedes.on("unsubscribe",function(subscriptions,client){console.log(`[TOPIC_UNSUBSCRIBED] Client ${client ? client.id : client} unsubscribed to topics: ${subscriptions.join(",")} from broker ${aedes.id}`);});// emitted when a client publishes a message packet on the topicaedes.on("publish",asyncfunction(packet,client){if(client){console.log(`[MESSAGE_PUBLISHED] Client ${client ? client.id : "BROKER_"+aedes.id} has published message on ${packet.topic} to broker ${aedes.id}`);}});ws.createServer({server: httpServer},aedes.handle);httpServer.listen(port,function(){console.log("websocket server listening on port ",port);});
What are we missing in the nodered configuration to run the mqtt broker over websockets and mTLS?
kr,
Joachim
The text was updated successfully, but these errors were encountered:
I think you need to enable SSL/TLS including server certificates in order to setup a secure connection. What error messages do you get in the Node-RED logs?
Hi,
I am trying to use aesed on nodered with an mTLS connection.
The only port that can be used is the https port so connection will be over websockets.
so I expect that I can connect to the broker on:
wss://my.domain.com/ws/mqtt
I created a nodejs client to connect like this:
The result in the console is always: Reconnecting ...
When we deploy a simple nodejs program with aedes broker in stead of the nodered application, the connection over mTLS is working.
code of the simple nodejs broker:
What are we missing in the nodered configuration to run the mqtt broker over websockets and mTLS?
kr,
Joachim
The text was updated successfully, but these errors were encountered: