Skip to content

Mosquitto authorization #17

Description

@Kaidoz

Hello. I am experiencing problems trying to connect hyperrtls to Mousquitto.

When trying to run the project and create .env, an error occurs:

[Nest] 35 - 07/30/2025, 12:04:50 PM LOG [DynamicSecurityController] Connecting to the MQTT broker...

/home/node/.yarn/cache/mqtt-npm-4.3.7-42cab96512-8d4b655d61.zip/node_modules/mqtt/lib/client.js:1388

const err = new Error('Connection refused: ' + errors[rc])

^

Error: Connection refused: Not authorized

at MqttClient._handleConnack (/home/node/.yarn/cache/mqtt-npm-4.3.7-42cab96512-8d4b655d61.zip/node_modules/mqtt/lib/client.js:1388:17) 

at MqttClient._handlePacket (/home/node/.yarn/cache/mqtt-npm-4.3.7-42cab96512-8d4b655d61.zip/node_modules/mqtt/lib/client.js:549:12) 

at work (/home/node/.yarn/cache/mqtt-npm-4.3.7-42cab96512-8d4b655d61.zip/node_modules/mqtt/lib/client.js:438:12) 

at writable._write (/home/node/.yarn/cache/mqtt-npm-4.3.7-42cab96512-8d4b655d61.zip/node_modules/mqtt/lib/client.js:452:5) 

at doWrite (/home/node/.yarn/cache/readable-stream-npm-3.6.0-23a4a5eb56-d4ea81502d.zip/node_modules/readable-stream/lib/_stream_writable.js:409:139) 

at writeOrBuffer (/home/node/.yarn/cache/readable-stream-npm-3.6.0-23a4a5eb56-d4ea81502d.zip/node_modules/readable-stream/lib/_stream_writable.js:398:5) 

atWritable.write (/home/node/.yarn/cache/readable-stream-npm-3.6.0-23a4a5eb56-d4ea81502d.zip/node_modules/readable-stream/lib/_stream_writable.js:307:11) 

at Socket.ondata (node:internal/streams/readable:766:22) 

at Socket.emit (node:events:513:28) 

at addChunk (node:internal/streams/readable:324:12) {

When trying to make anonymous authorization in mosquitto('allow_anonymous true'):


[Nest] 35  - 07/30/2025, 12:08:33 PM     LOG [DynamicSecurityController] Subscribing to Dynamic Security responses topic...

[Nest] 35  - 07/30/2025, 12:08:33 PM     LOG [DynamicSecurityController] Successfully established connection

/home/node/dist/nestjs-dynsec/dynsec.controller.js:84

                reject(new Error('Command timed out'));

                       ^

Error: Command timed out

    at Timeout._onTimeout (/home/node/dist/nestjs-dynsec/dynsec.controller.js:84:24)

    at listOnTimeout (node:internal/timers:569:17)

    at process.processTimers (node:internal/timers:512:7)

Node.js v18.15.0

Is there a ready-made working configuration that can be run?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions