1

After a research i'm gonna try to explain the whole process i've been trough to try to solve the problem.

First, the idea was to make a WebSocket connections with the users of my app with the server to basically share some information, all this process works perfectly if we are not under SSL.

The moment my server was secured, i got two messages, first, i couldn't do a connection to a non secure WebSocket Service under SSL, obvious reasons. Then i tried the secure connection and also failed with a 400 hand shake failure.

Then i started my research about the problem, i saw that ratchet documentation didn't tell me anything new about this matter, at least not that could find. After that, i found this.

php ratchet websocket SSL connect?

I asked my provider to install and configure this Apache modules (Apache version 2.4.25, just in case that gives any valuable information). The configuration worked since now i can make the connection with the ws://www.website.com /ws/ and works fine. But now when i try wss connection, i get a timed out response:

/* Apache error

[Mon Feb 06 16:49:02.966991 2017] [cgi:error] [pid 8969] (70014)End of file found: [client ipadress:port] AH01225: Error reading request entity data [Mon Feb 06 16:51:42.530383 2017] [cgi:error] [pid 9837] (70014)End of file found: [client ipadress:port] AH01225: Error reading request entity data

*/

And the last thing, about the Stunnel configuration, im not sure what ports should i use on those variables.

https://www.stunnel.org/config_unix.html

 [websockets]
 accept = 8443 
 connect = 8888 //i guess here the port where my WS is running?

For now, with all this information and the research i did, i'm not able to find any other clue that could help me solve this.

Thanks in advance.

Community
  • 1
  • 1

2 Answers2

0

Please check the answer here, where I share how to configure Apache server to access wss:// and ws:// at the same time.

PHP websocket on SSL with proxy_wsTunnel - Apache

Community
  • 1
  • 1
Arithran
  • 1,219
  • 3
  • 11
  • 22
0

After hours of strugling with Radchet i've got it working on a new Windows 2016 machine with IIS 10.0.

My Ratchat server is started from the commandline, and is running on localhost:8585

  • Using Windows 2016 with IIS10.0, installed the Websocket feature (but not used in IIS).
  • Created a new website, with HTTPS binding on port 443.
  • This site is a dummy site, no html / web files.
  • Create a Application Proxy rewrite rule, see web.config:

    
    
        
            
                
                    
                        
                        
                            
                            
                        
                        
                    
                
            
        
    

  • The client can connect with the wss://yoursertcomain.com:443 and IIS will pass the requests to/from Ratchet.

Our application is now over WSS up-and-running.

PS: Using the loopback IP-adress 127.0.0.1 instead of 'localhost', otherwise connecting takes 1 second, now it's serveral ms.