-
-
Notifications
You must be signed in to change notification settings - Fork 150
Can't connect socket over WSS on firefox #239
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
Comments
in https you should use localhost:[port] in place of 127.0.0.1:[port] |
Thanks for your answer. In fact, that's what i did. And it still doesn't work. |
You should also add your domain in the list of origins:
in the config.ini file or it will be not whitelisted. |
Yes i did that as well. Firefox says that the certificate issuer is unknown. I know that Firefox doesn't trust Window's certificate store, so that's the reason why. I found the /certificate.crt API in order to make Firefox accept the certificate. My question is: is there any other way of doing that ? Like an install script that would modify Firefox built-in certificates DB ? I noticed that there was no need for accessing the /certificate.crt API on the arduino create website, and it works good on Firefox. Thanks a lot. |
what version of the agent are you using? Actually Firefox should work fine in plain http, using 127.0.0.1 endpoints |
I'm using version 1.1.71. The problem happens when i try connecting the websocket. Since the website uses HTTPS, Firefox doesn't allow unsecure websocket connections in ws://. Accessing the /info API works fine without HTTPS, but not the socket.io io() function. When i try it in ws:// (on 127.0.0.1), the connection won't happen, and the console says "The operation is unsecure". |
Do you want to try our new js module? https://github.com/arduino/arduino-create-agent-js-client |
Thanks. I already knew about it (looks good btw). If no one has a solution for my issue, then i'll be happy to try it. 👍 |
we just fixed an issue, please try arduino-create-agent-js-client version 1.0.11 |
You have to generate the cert by using
|
Ok, thanks for the info. Now i'm able to make Firefox trust the CA. I noticed that using the plugin on the arduino create website doesn't require such procedure. How is this possible ? |
Because we do not use https for localhost because it is completely useless, that's why we us http and 127.0.0.1. https://bugzilla.mozilla.org/show_bug.cgi?id=903966 |
I tried http with 127.0.0.1. But Firefox doesn't allow it since the main connection to the website is in HTTPS. |
Do you have the last version of FF? |
@nzaouesgi you are correct if you use wss that is not possible and you should use https. We do not use wss in our implementation but we do use socket.io that reverts back to long polling in this specific case. So we indeed use long polling, which is not the best solution for performance but still the best from a UX point of view. The Firefox fix mentioned in bugzilla only works for http but not for ws. |
@mastrolinux thanks, now i get it. issue solved. @smellai it's all right, mastrolinux solved it ! |
Hi everyone !
Here is my problem:
At first I was using ws:// and then i noticed that Firefox doesn't accept ws:// connections when the website is over HTTPS (i got the "this is insecure" error from socket.io). Well, my website is over HTTPS. So i changed it to wss://.
I already had changed my config.ini (origins and signatureKey). I get the endpoints from 127.0.0.1:8991/info but then the socket won't connect, and it reads "CORS request failure" from the console.
This is happening only in Firefox, Chrome works fine. I tried reinstalling the agent with the certificate several times, even manually, and it doesn't work.
Any idea ? Thank a lot.
The text was updated successfully, but these errors were encountered: