New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection closed before receiving a handshake response #154

Open
pokal4u opened this Issue May 4, 2018 · 11 comments

Comments

Projects
None yet
4 participants
@pokal4u

pokal4u commented May 4, 2018

Hi,
We are getting below error in some browsers(chrome or mozilla) when we connect mqtt using web sockets. When we clear browser history then connected.
Error:
WebSocket connection to 'wss://host:port/mqtt' failed: Connection closed before receiving a handshake response Paho.MQTT.ClientImpl._doConnect @ mqttws31.js:979

My connection:

var client = new Paho.MQTT.Client("host", Number(port), "myClientId" + new Date().getTime());
client.connect({userName:username,password:password,onSuccess:onConnect,onFailure:doFail,useSSL:true,cleanSession:false});

So please look into this.
Thanks

@pokal4u

This comment has been minimized.

Show comment
Hide comment
@pokal4u

pokal4u May 8, 2018

any one please look into this

pokal4u commented May 8, 2018

any one please look into this

@DayTimeDreamer

This comment has been minimized.

Show comment
Hide comment
@DayTimeDreamer

DayTimeDreamer May 8, 2018

Maybe you don't boot the broker properly. Which broker do you use? Or you can try set useSSL=false.

DayTimeDreamer commented May 8, 2018

Maybe you don't boot the broker properly. Which broker do you use? Or you can try set useSSL=false.

@pokal4u

This comment has been minimized.

Show comment
Hide comment
@pokal4u

pokal4u May 8, 2018

broker: mosquitto.
Our site running on https, so useSSL should be true. If set false getingt error.
And mqtt connected for some users(in all browsers) without clearing browser cache.

Please check attache files of chrome versions and response code of different systems, one system got error and another one connected succesfully.

Mosquitto configuration:

Plain WebSockets configuration
listener port
protocol websockets

WebSockets over TLS/SSL
listener port
protocol websockets
cafile ca.crt
certfile cer.crt
keyfile key

mqtt_connet
mqtt_connet1
mqtt_disconnect
mqtt_disconnect1

pokal4u commented May 8, 2018

broker: mosquitto.
Our site running on https, so useSSL should be true. If set false getingt error.
And mqtt connected for some users(in all browsers) without clearing browser cache.

Please check attache files of chrome versions and response code of different systems, one system got error and another one connected succesfully.

Mosquitto configuration:

Plain WebSockets configuration
listener port
protocol websockets

WebSockets over TLS/SSL
listener port
protocol websockets
cafile ca.crt
certfile cer.crt
keyfile key

mqtt_connet
mqtt_connet1
mqtt_disconnect
mqtt_disconnect1

@jpwsutton

This comment has been minimized.

Show comment
Hide comment
@jpwsutton

jpwsutton May 8, 2018

Member

This looks like it could be an HTTPS issue, does this only happen with Secure websockets connection, or with plain connections as well?

Member

jpwsutton commented May 8, 2018

This looks like it could be an HTTPS issue, does this only happen with Secure websockets connection, or with plain connections as well?

@pokal4u

This comment has been minimized.

Show comment
Hide comment
@pokal4u

pokal4u May 8, 2018

for plain connection also getting same error in same browser, but why this relation with browser cache? when I clear cache then connected

pokal4u commented May 8, 2018

for plain connection also getting same error in same browser, but why this relation with browser cache? when I clear cache then connected

@jpwsutton

This comment has been minimized.

Show comment
Hide comment
@jpwsutton

jpwsutton May 8, 2018

Member

Can you try this against the server at iot.eclipse.org and confirm if you see the same problems connecting to that please?

Member

jpwsutton commented May 8, 2018

Can you try this against the server at iot.eclipse.org and confirm if you see the same problems connecting to that please?

@pokal4u

This comment has been minimized.

Show comment
Hide comment
@pokal4u

pokal4u May 8, 2018

using this "iot.eclipse.org" connected in all browsers. Please suggest me where I did wrong.
I will share more info if required.

pokal4u commented May 8, 2018

using this "iot.eclipse.org" connected in all browsers. Please suggest me where I did wrong.
I will share more info if required.

@jpwsutton

This comment has been minimized.

Show comment
Hide comment
@jpwsutton

jpwsutton May 8, 2018

Member

Looks like it might be a configuration issue with your instance of Mosquitto, I'd suggest checking the Mosquitto logs to see if there is anything in that might explain the connection loss.

Member

jpwsutton commented May 8, 2018

Looks like it might be a configuration issue with your instance of Mosquitto, I'd suggest checking the Mosquitto logs to see if there is anything in that might explain the connection loss.

@pokal4u

This comment has been minimized.

Show comment
Hide comment
@pokal4u

pokal4u May 8, 2018

Where can I enable logs and any default location for saved logs?

pokal4u commented May 8, 2018

Where can I enable logs and any default location for saved logs?

@pokal4u

This comment has been minimized.

Show comment
Hide comment
@pokal4u

pokal4u May 9, 2018

in logs getting this error "Ran out of header data space"

pokal4u commented May 9, 2018

in logs getting this error "Ran out of header data space"

@luiscolmenares

This comment has been minimized.

Show comment
Hide comment
@luiscolmenares

luiscolmenares Jul 19, 2018

Hi @pokal4u were you able to resolve this? I am having the same issue!

luiscolmenares commented Jul 19, 2018

Hi @pokal4u were you able to resolve this? I am having the same issue!

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