Skip to content
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 to broker failed using Websocket + TLS + Chrome #1335

Closed
demian85 opened this issue Oct 6, 2021 · 18 comments
Closed

Connection to broker failed using Websocket + TLS + Chrome #1335

demian85 opened this issue Oct 6, 2021 · 18 comments

Comments

@demian85
Copy link

demian85 commented Oct 6, 2021

Hey guys. I'm really confused and this is driving me crazy. Please help me out.
I have a Web app using this lib to connect to a custom broker implementation (aedes) using a secure websocket connection.
It has been working forever, up until a few days ago. Now it magically fails ONLY in Chrome an Safari. It works in Firefox!

This is the error I keep getting over and over again. There are no logs on the server-side because it's like the browser closes the connection before it is even established!

image

Does anyone have an idea what the hell is going on? Is this something related to the TLS certificates? Those have been renewed a month ago and will expire in 2 months. Double checked. Also, and again, in Firefox it works!

Thanks!

@YoDaMa
Copy link
Contributor

YoDaMa commented Oct 6, 2021

So you are able to connect, and then after connection, during subscribe, the connection is closed? Can you provide a minimal viable reproducible snippet, so we can dig into the error?

@YoDaMa YoDaMa self-assigned this Oct 6, 2021
@demian85
Copy link
Author

demian85 commented Oct 6, 2021

This is even weirder than I thought. It works on Chrome + Linux. The problem seems to be Mac + Chrome. Is this for real? What changed in the latest Chrome version that broke everything?

@YoDaMa
Copy link
Contributor

YoDaMa commented Oct 7, 2021

I couldn't tell you, honestly.

@YoDaMa
Copy link
Contributor

YoDaMa commented Oct 22, 2021

is there any way we can help you? If not feel free to close this issue.

@demian85
Copy link
Author

demian85 commented Oct 22, 2021 via email

@demian85
Copy link
Author

demian85 commented Dec 9, 2021

Pump!
I'm still having the same weird issue and I cannot even find anything useful in Google...
Can Websockets be established cross-domain? It always worked like that. Did anything change lately?
It still works on Firefox!

@demian85
Copy link
Author

demian85 commented Dec 9, 2021

Tried changing the domain for an IP, tried changing protocol, ws:// ws://, nothing works! What does this mean? Worst error message ever...
image

@YoDaMa
Copy link
Contributor

YoDaMa commented Dec 9, 2021

@demian85 please give a reproducible example and we would be happy to see what your problem is. Right now I cannot follow you.

@pablogallero
Copy link

Hello, I'm having the same issue. Any idea what can I do?

@angelofan
Copy link

I'm having the same issue.

@robertsLando
Copy link
Member

robertsLando commented Jul 3, 2023

I think this problem only happens when the server certificate isn't trusted for some reason, you should check why the broker rejects the connection if you cannot find out why the connection fails on client

@robertsLando
Copy link
Member

MQTT 5.0.0 BETA is now available! Try it out and give us feedback: npm i mqtt@beta. It may fix your issues

@jaketakula
Copy link

jaketakula commented Oct 24, 2023

hey, we are having this issue with mqttjs v4.2.8.
it happens realy but when it happens, the broswer keeps failing to connect.
the place is exactly same at new WebSocket()
does anyone can help ? thx a lots.
cc @robertsLando @demian85

@robertsLando
Copy link
Member

@jaketakula Firstly update to latest 5.1.3

@jaketakula
Copy link

@jaketakula Firstly update to latest 5.1.3

thx for the quick reply. will give it a try and update it later on.

@0viii0viii
Copy link

@jaketakula any update on this issue?

@robertsLando
Copy link
Member

I sincerly have no clue about this as I'm using WSS with mqttjs in almost all my projects without any issue. If someone can give me some debug logs or else to reproduce the issue I will give them a look. In the meanwhile I close this

@jaketakula
Copy link

jaketakula commented Feb 1, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants