Skip to content

MQTTS connection error on nodejs >= 8.6.0 #699

Closed

Description

@redboltz

After updating nodejs from 8.5.0 to 8.6.0, MQTTS connection becomes failure.

The reason is the commit nodejs/node@ee157e5a7f
See https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V8.md#8.6.0

Here is the document.
https://nodejs.org/api/tls.html#tls_tls_connect_options_callback

"path Creates unix socket connection to path. If this option is specified, host and port are ignored."

I analyzed the problem. And
https://github.com/mqttjs/MQTT.js/blob/master/lib/connect/index.js#L60 adds path member.

And the variable opt that contains path member passed to https://github.com/mqttjs/MQTT.js/blob/master/lib/connect/tls.js#L11

Hence host and port are ignored.

Activity

  1. redboltz commented on Oct 16, 2017

    @redboltz
    ContributorAuthor

    I realized that I passed mqtts://hostname:1234/. If I remove the last /, the connection is successfully finished. However, I think that ignoring path might be convenient. Because existing working code don't need to be changed.

    So I post the PR #700.

  2. bengl commented on Oct 17, 2017

    @bengl

    Perhaps MQTT should be in https://github.com/nodejs/citgm ?

  3. mcollina commented on Oct 17, 2017

    @mcollina
    Member

    @bengl I think so, too. However our tests are network heavy and they tend to bet too flaky to be in CITGM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions