socket.io-client-dart icon indicating copy to clipboard operation
socket.io-client-dart copied to clipboard

Unable to connect to HTTPS Server Server Node JS

Open SBDHERA opened this issue 4 years ago • 5 comments

I am using this library I am unable to figure out how I can pass SSL Certificate using HTTPS call for Socket IO.

IO.Socket socket = IO.io(SOCKET_URL, OptionBuilder().setTransports(['websocket']).build());

socket.onConnecting(() => print('Connecting...')); socket.on('event', (data) => print('data ' + data.toString())); socket.onDisconnect(() => print('disconnect')); socket.on('connect_error', (data) => print('connect_error ' + data.toString())); socket.on('error', (data) => print('error ' + data.toString()));

socket.onConnect((_) { print('connect'); socket.emit('msg', 'test'); });

The Error which I am getting: Unhandled exception:HandshakeException: Handshake error in client (OS Error:CERTIFICATE_VERIFY_FAILED

Also some time I am getting timeout error.

I would like to thank if someone can assist me how I can resolve that issue?

Thanks

SBDHERA avatar Jan 26 '21 06:01 SBDHERA

what is the server side socket IO version?

jayaram9877 avatar Jan 31 '21 13:01 jayaram9877

@SBDHERA FYI: https://github.com/rikulo/socket.io-client-dart#cannot-connect-https-server-or-self-signed-certificate-server

jumperchen avatar Feb 01 '21 03:02 jumperchen

Socket connection works fine when connected to localhost(Ex - http://172.20.10.3:4000/), but when connected to url which is hosted on heroku,it stops working. Please help.

tanmoydas61999 avatar Jun 19 '21 13:06 tanmoydas61999

Socket connection works fine when connected to localhost(Ex - http://172.20.10.3:4000/), but when connected to url which is hosted on heroku,it stops working. Please help.

Did you fix it? What was the problem?

hmarat avatar Jul 05 '21 18:07 hmarat

+1

Domzak avatar Aug 28 '21 13:08 Domzak