menu

arrow_back How do I fix a 403 error when connecting to WebSocket?

by
1 vote
A simple webchat on ratchet on instructions . Chat works fine on the local machine, but on the server when you try to connect you get an error 403
VM3045:1 WebSocket connection to 'ws://172.67.162.12:8080/' failed: Error in connection establishment: net::ERR_SSL_PROTOCOL_ERROR

So far I suspect that the problem is port or file availability from another machine, but how can this be fixed?

4 Comments

And besides, ws is an unencrypted connection, for an encrypted one the wss protocol is used.
Ingvar Von Björk What domain is your ssl certificate for? If you use it for another domain or IP address, then, of course, this certificate does not confirm the validity of the data.
Dmitry Kuznetsov , 172.67.162.12 - random address. I just plugged it in so I wouldn't mess with the server. WS gives out exactly 403.
Well, if you go to https://172.67.162.12/ The error message says that you can't connect directly to the IP. I assume that there will be an error in WS as well.

1 Answer

by
0 votes
The error is clearly stated: ERR_SSL_PROTOCOL_ERROR - which means ssl protocol error, what does this have to do with the port?
The problem is your certificate, most likely it is not valid or it just does not exist! In this case, you probably connect via wss.
And google error codes 403 - access denied.

https://stackoverflow.com/questions/23404160/why-d...

1 comment

Yes, it's not the port - I changed ws to wss when connecting and now it gives out WebSocket opening handshake timed out
Could this error be due to an incorrect certificate or could the problem be something else?