3

i could connect to my websocket php server on client side js file like this:

websocket = new WebSocket("ws://mysite.com:9091");   

but now we bought ssl for our server , so url start with Https instead of Http Now we can't connect to ws:// so i changed it to wss:// but still can't connect to server

failed: Error in connection establishment: net::ERR_SSL_PROTOCOL_ERROR
Sam Rad
  • 451
  • 2
  • 5
  • 13
  • 1
    What server are you using. Is the server accepting tls connections and listening to the port? – PeeHaa Aug 03 '16 at 20:40
  • server is Linux CentOs, and i could connect to server til yesterday without problem. but since yesterday we bought ssl for server .and everything stops working – Sam Rad Aug 03 '16 at 21:28
  • 1
    @samanrad: you probably don't have SSL at port 9091 configured but at another port. Or you have configured your server wrong - look at the server side log files for any clues. – Steffen Ullrich Aug 04 '16 at 05:29
  • @Steffen Ullrich do you mean that we have to enable ssl for 9091 port also in our server configuration ? our site already works with https – Sam Rad Aug 04 '16 at 06:38
  • 1
    @samanrad: since you explicitly give the port number in your wss URL you have to also enable HTTPS there. wss:// is an upgrade of a https:// connection same as ws:// is an upgrade of an http:// connection. – Steffen Ullrich Aug 04 '16 at 07:41
  • @Steffen can you write how i have to do it ? – Sam Rad Aug 04 '16 at 20:18
  • @samanrad: I have no idea of your setup and thus cannot provide any hints. But I'm pretty sure that you can easily find lots of information on how to setup a wss:// server properly and apply these to your specific environment. If you then still have problems please provide enough details about your setup in your question so one can actually help you. – Steffen Ullrich Aug 04 '16 at 20:32
  • @SteffenUllrich lets say if someone was using letsencrypt certificate, on ubuntu 18.04, amazon aws, and using virtual hosts to house the domain (among multiple domains) then how would you do it.. – DragonFire May 12 '20 at 03:19
  • 1
    @DragonFire: Comments should not be used to ask new questions, even more since the original question is many years old. Please ask a real question instead with a clear problem description and sufficient details. – Steffen Ullrich May 12 '20 at 04:33
  • @SteffenUllrich first I'll try to do myself, then if a problem comes then I will post a question, but thanks for your response... – DragonFire May 12 '20 at 07:04

0 Answers0