moscajs / mosca

MQTT broker as a module
mosca.io
3.2k stars 508 forks source link

Does SSL disable non-SSL MQTT on port 1883? #574

Closed RickCarlino closed 7 years ago

RickCarlino commented 7 years ago

Greetings,

Mosca version: 2.2.0 Node -v: v7.1.0 Running on a debian based system. No backend persistence mechanisms.

I am unable to connect to TCP port 1883 when SSL is enabled. Enabling SSL does not interfere with wss:// or ws://. It does appear to interfere with TCP port 1883.

As soon as I add the following variables to my server config, port 1883 stops working:

"bad" config object that does not allow connections to port 1883:

{
    port: 1883,
    http: {
        port: 3002,
        bundle: true,
        static: './public'
    },
    secure: {
        port: 8883,
        keyPath: 'privkey.pem',
        certPath: 'cert.pem'
    },
    https: {
        port: 443
    }
}

Config object that is known to work (supports TCP 1883):

{
    port: 1883,
    http: {
        port: 3002,
        bundle: true,
        static: './public'
    }
}

Our full source code is available, but might be a bit too much information.

Thanks for all the great work on this project!

RickCarlino commented 7 years ago

SOLVED. I did not realize there was a allowNonSecure flag for configs.