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

MQTTX web fails to connect when disabling SSL security with wss, but the desktop version of MQTTX works. #1448

Closed
ZKUTF-8 opened this issue Oct 12, 2023 · 2 comments
Assignees
Labels
bug Something isn't working discussion This issues and pr are worth discussing help wanted Extra attention is needed web MQTTX Web
Milestone

Comments

@ZKUTF-8
Copy link

ZKUTF-8 commented Oct 12, 2023

What I did:

I tried connecting using the web version of MQTTX with wss while ignoring SSL security
image
image

but it failed to connect. However, it works with the desktop version.
image
image

Environment:

OS: Windows 11
MQTTX version: e.g. v1.9.5
EMQX: Running on Docker 5.1.6

Detailed Information:

I need to use wss under HTTPS. Following the official guide, I used mqtt.js. Since certificates are required, I set the rejectUnauthorized: false to ignore verification. The result was a connection failure. So, I tested using MQTTX's web and found it also failed. However, it worked with the desktop version of MQTTX. I'm very puzzled, and this issue has troubled me for a long time. Thank you very much.

@ZKUTF-8 ZKUTF-8 added the bug Something isn't working label Oct 12, 2023
@github-project-automation github-project-automation bot moved this to Backlog in MQTTX Oct 12, 2023
@ZKUTF-8
Copy link
Author

ZKUTF-8 commented Oct 12, 2023

After installing EMQX, I didn't make any configurations. Did I do something wrong? Or can't SSL verification be ignored in a web environment? However, mqtt.js said it's possible. Thank you very much.

@ysfscream ysfscream added the web MQTTX Web label Oct 16, 2023
@ysfscream ysfscream moved this from Backlog to In Progress in MQTTX Oct 16, 2023
@ysfscream ysfscream added this to the v1.9.7 milestone Oct 16, 2023
@ysfscream ysfscream added help wanted Extra attention is needed discussion This issues and pr are worth discussing labels Oct 17, 2023
@ysfscream
Copy link
Member

Hello @ZKUTF-8,

I apologize for the delayed response. After conducting some tests, I've found that using MQTT.js in a Node.js environment works fine, but not in a browser setting. This could be attributed to the differences between the two environments. It's worth noting that MQTTX desktop operates in a Node.js context.

I've tried configuring the WSS for emqx without success. You should correctly set up the SSL/TLS certificates for emqx to establish a successful WSS connection. For further assistance, I'd recommend posting on the EMQX forum to inquire about the right way to configure WSS.

I deeply regret the inconvenience this has caused, and I appreciate your understanding.

@ysfscream ysfscream changed the title MQTTX web连接wss时禁用SSL安全任然连接失败,MQTTX的桌面版本是可以的 MQTTX web fails to connect when disabling SSL security with wss, but the desktop version of MQTTX works. Oct 17, 2023
@ZKUTF-8 ZKUTF-8 closed this as completed Oct 17, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in MQTTX Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working discussion This issues and pr are worth discussing help wanted Extra attention is needed web MQTTX Web
Projects
Status: Done
Development

No branches or pull requests

3 participants