-
Notifications
You must be signed in to change notification settings - Fork 246
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
Cannot connect to secure WSS #50
Comments
If you can provide some code we'll can help. wss:// works fine for me with apache2 default and php7.0 |
I'm having the same problem, but it shows error on line 60, not on 95. The server is ok, running wss, and Chrome can connect. My server is a Nginx running SSL via proxy. Fatal error: Uncaught exception 'WebSocket\ConnectionException' with message 'Could not open socket to "xxxxx:443": (0).' in /.../textalk/websocket/lib/Client.php:60 |
Found the problem! Maybe help @winternet-studio or others. The problem was not on Textalk. The server (Nginx) was missing the intermediate certificate. Checked using https://www.sslshopper.com/ssl-checker.html. To fix: on Nginx "ssl_certificate" must point to a file with the certificate concatenated with the CA certificate. Just "cat cert.pem ca.pem > output.pem" and use it on Nginx. Same thing on Apache, on "SSLCertificateFile". Using Let's Encrypt, just use fullchain.pem instead of cert.pem. |
ssl-checker didn't indicate any problems on my server - it says "all the correct intermediate certificates are installed" and everything else is green as well. I'm also using Let's Encrypt. Not sure what code to share. I try to connect to the server using this standard code:
In Javascript this code works fine:
If you contact me through my website I can let you know the actual server so you could try it yourself if you're interested. |
Hi, I have the exact same configuration with nginx proxying ssl to :8000 websocket server, can connect from browsers, but not from the server itself. Was wondering whether you've had any luck figuring it out? Thanks in advance! |
Sorry, I have not tried anything or found any solutions since my post. |
Thanks for the reply. |
I've now picked this up again and I found out that it didn't work on my Windows developer machine, but the same code worked fine on a production Linux server. I also tried an asynchronous client https://github.com/ratchetphp/Pawl which also had issue on my local machine but worked fine on Linux server. Hopefully this bit of info might be helpful to someone. |
I figured it out as well, here is the deal.
Hope this will help someone as well :). |
I had the sane issue. The problem was that I am restricting access to ws to the origins "localhost" and "our domain". This library doesn't send an origin in the header. Got it fixed by adding |
I too had the same issue with localhost wss:// Below code worked for me for byepassing certificate validation |
For me also bypassing the SSL worked.... |
hello @sandy5623 it would be great help if you can share the full code as tried the above but unable make it work and also the latest version gives array error in second parameter so not able to figure out how to use above code thanks in advance |
Connecting to ws:// works fine but when I use wss:// to the same server (which works just fine in the browser and a websocket tester) it fails:
Any idea what the problem can be?
The server uses Apache modules
proxy
andproxy_wstunnel
to make the secure connection (followed https://stackoverflow.com/questions/16979793/php-ratchet-websocket-ssl-connect#28393526). Internally the websocket server runs on a port above 8000.The text was updated successfully, but these errors were encountered: